﻿namespace ACCOUNTING
{
    using ACCOUNTING.LVY.Business;
    using ACCOUNTING.My;
    using ACCOUNTING.My.Resources;
    using C1.Win.C1Command;
    using C1.Win.C1FlexGrid;
    using C1.Win.C1FlexGrid.Util.BaseControls;
    using C1.Win.C1Input;
    using Microsoft.VisualBasic;
    using Microsoft.VisualBasic.CompilerServices;
    using System;
    using System.Collections;
    using System.Collections.Generic;
    using System.ComponentModel;
    using System.Data;
    using System.Diagnostics;
    using System.Drawing;
    using System.Runtime.CompilerServices;
    using System.Windows.Forms;

    [DesignerGenerated]
    public class Frm_PhieuGiaoHang : Form
    {
        private static List<WeakReference> __ENCList = new List<WeakReference>();
        [AccessedThroughProperty("AdvGiaoNhan")]
        private ADVObjects _AdvGiaoNhan;
        [AccessedThroughProperty("AdvKhachHang")]
        private ADVObjects _AdvKhachHang;
        [AccessedThroughProperty("AdvNhanVien")]
        private ADVObjects _AdvNhanVien;
        [AccessedThroughProperty("AdvTaiKhoanChu")]
        private ADVAccount _AdvTaiKhoanChu;
        [AccessedThroughProperty("C1DockingTab1")]
        private C1DockingTab _C1DockingTab1;
        [AccessedThroughProperty("C1DockingTab2")]
        private C1DockingTab _C1DockingTab2;
        [AccessedThroughProperty("C1DockingTabPage1")]
        private C1DockingTabPage _C1DockingTabPage1;
        [AccessedThroughProperty("C1DockingTabPage2")]
        private C1DockingTabPage _C1DockingTabPage2;
        [AccessedThroughProperty("CboDiaChiGiaoHang")]
        private ComboBox _CboDiaChiGiaoHang;
        [AccessedThroughProperty("CboLienHe")]
        private ComboBox _CboLienHe;
        [AccessedThroughProperty("CboLoaiDuLieu")]
        private ComboBox _CboLoaiDuLieu;
        [AccessedThroughProperty("CboLoaiGia")]
        private ComboBox _CboLoaiGia;
        [AccessedThroughProperty("CboLoaiTien")]
        private ComboBox _CboLoaiTien;
        [AccessedThroughProperty("CKChietKhauTheoHD")]
        private CheckBox _CKChietKhauTheoHD;
        [AccessedThroughProperty("CKTachThue")]
        private CheckBox _CKTachThue;
        [AccessedThroughProperty("CmdAdd")]
        private ToolStripButton _CmdAdd;
        [AccessedThroughProperty("CmdAddRow")]
        private Button _CmdAddRow;
        [AccessedThroughProperty("CmdChuyen")]
        private Button _CmdChuyen;
        [AccessedThroughProperty("CmdDel")]
        private ToolStripButton _CmdDel;
        [AccessedThroughProperty("CmdDelRow")]
        private Button _CmdDelRow;
        [AccessedThroughProperty("CmdEdit")]
        private ToolStripButton _CmdEdit;
        [AccessedThroughProperty("CmdExit")]
        private ToolStripButton _CmdExit;
        [AccessedThroughProperty("CmdFind")]
        private ToolStripButton _CmdFind;
        [AccessedThroughProperty("CmdPrint")]
        private ToolStripSplitButton _CmdPrint;
        [AccessedThroughProperty("CmdPrintBienBan")]
        private ToolStripButton _CmdPrintBienBan;
        [AccessedThroughProperty("cmdPrintEN")]
        private ToolStripMenuItem _cmdPrintEN;
        [AccessedThroughProperty("cmdPrintVI")]
        private ToolStripMenuItem _cmdPrintVI;
        [AccessedThroughProperty("CmdSave")]
        private ToolStripButton _CmdSave;
        [AccessedThroughProperty("cmdTimDonHang")]
        private Button _cmdTimDonHang;
        [AccessedThroughProperty("CmdTimDuAn")]
        private Button _CmdTimDuAn;
        [AccessedThroughProperty("CmdUnsave")]
        private ToolStripButton _CmdUnsave;
        [AccessedThroughProperty("ImageList1")]
        private ImageList _ImageList1;
        [AccessedThroughProperty("Label1")]
        private Label _Label1;
        [AccessedThroughProperty("Label11")]
        private Label _Label11;
        [AccessedThroughProperty("Label13")]
        private Label _Label13;
        [AccessedThroughProperty("Label16")]
        private Label _Label16;
        [AccessedThroughProperty("Label19")]
        private Label _Label19;
        [AccessedThroughProperty("Label2")]
        private Label _Label2;
        [AccessedThroughProperty("Label21")]
        private Label _Label21;
        [AccessedThroughProperty("Label22")]
        private Label _Label22;
        [AccessedThroughProperty("Label23")]
        private Label _Label23;
        [AccessedThroughProperty("Label25")]
        private Label _Label25;
        [AccessedThroughProperty("Label28")]
        private Label _Label28;
        [AccessedThroughProperty("Label29")]
        private Label _Label29;
        [AccessedThroughProperty("Label3")]
        private Label _Label3;
        [AccessedThroughProperty("Label33")]
        private Label _Label33;
        [AccessedThroughProperty("Label34")]
        private Label _Label34;
        [AccessedThroughProperty("Label4")]
        private Label _Label4;
        [AccessedThroughProperty("Label5")]
        private Label _Label5;
        [AccessedThroughProperty("Label6")]
        private Label _Label6;
        [AccessedThroughProperty("Label7")]
        private Label _Label7;
        [AccessedThroughProperty("Label9")]
        private Label _Label9;
        [AccessedThroughProperty("mnBaoGia")]
        private ToolStripMenuItem _mnBaoGia;
        [AccessedThroughProperty("mnChungTuGoc")]
        private ContextMenuStrip _mnChungTuGoc;
        [AccessedThroughProperty("mnDonHang")]
        private ToolStripMenuItem _mnDonHang;
        [AccessedThroughProperty("Panel4")]
        private Panel _Panel4;
        [AccessedThroughProperty("Panel5")]
        private Panel _Panel5;
        [AccessedThroughProperty("PNDungChung")]
        private Panel _PNDungChung;
        [AccessedThroughProperty("ToolStrip1")]
        private ToolStrip _ToolStrip1;
        [AccessedThroughProperty("ToolStripButton1")]
        private ToolStripSeparator _ToolStripButton1;
        [AccessedThroughProperty("ToolStripButton2")]
        private ToolStripButton _ToolStripButton2;
        [AccessedThroughProperty("ToolStripSeparator1")]
        private ToolStripSeparator _ToolStripSeparator1;
        [AccessedThroughProperty("ToolStripSeparator2")]
        private ToolStripSeparator _ToolStripSeparator2;
        [AccessedThroughProperty("ToolStripSeparator3")]
        private ToolStripSeparator _ToolStripSeparator3;
        [AccessedThroughProperty("TxtChietKhauNT")]
        private C1NumericEdit _TxtChietKhauNT;
        [AccessedThroughProperty("TxtDienGiai")]
        private TextBox _TxtDienGiai;
        [AccessedThroughProperty("TxtDienThoai")]
        private TextBox _TxtDienThoai;
        [AccessedThroughProperty("TxtDuAn")]
        private TextBox _TxtDuAn;
        [AccessedThroughProperty("TxtGhiChuGiaoHang")]
        private TextBox _TxtGhiChuGiaoHang;
        [AccessedThroughProperty("TxtNgayChungTu")]
        private DateTimePicker _TxtNgayChungTu;
        [AccessedThroughProperty("TxtNgayDathang")]
        private DateTimePicker _TxtNgayDathang;
        [AccessedThroughProperty("TxtSoChungTu")]
        private TextBox _TxtSoChungTu;
        [AccessedThroughProperty("TxtSoDonHang")]
        private TextBox _TxtSoDonHang;
        [AccessedThroughProperty("TxtSoLuong")]
        private C1NumericEdit _TxtSoLuong;
        [AccessedThroughProperty("TxtThueSuat")]
        private C1NumericEdit _TxtThueSuat;
        [AccessedThroughProperty("TxtTienHangNT")]
        private C1NumericEdit _TxtTienHangNT;
        [AccessedThroughProperty("TxtTienThueNT")]
        private C1NumericEdit _TxtTienThueNT;
        [AccessedThroughProperty("TxtTienVonNT")]
        private C1NumericEdit _TxtTienVonNT;
        [AccessedThroughProperty("TxtTongThanhToanNT")]
        private C1NumericEdit _TxtTongThanhToanNT;
        [AccessedThroughProperty("TxtTyLeChietKhau")]
        private C1NumericEdit _TxtTyLeChietKhau;
        [AccessedThroughProperty("VSHangHoa")]
        private C1.Win.C1FlexGrid.C1FlexGrid _VSHangHoa;
        private string cFrmFormat;
        private int cFrmGhiSo;
        public string cFrmKhoa;
        private string cFrmKhoaOld;
        private string cFrmTask;
        private IContainer components;
        private bool mAllowAdd;
        private bool mAllowDel;
        private bool mAllowEdit;
        private bool mAllowView;
        private bool mEnabledControl;
        private string mLoaiChungTu;
        private clsDMDonViTinh objDVT;
        private clsXuatKho objHD;
        private clsHoaDonChiTietDichVu objHDDV;
        private clsXuatKhoChiTiet objHDHH;
        private clsDMHangHoa objHH;
        private clsDMLoaiTien ObjLT;
        private clsSoChungTu objSoCT;
        private DataTable pdt;

        public Frm_PhieuGiaoHang()
        {
            base.KeyDown += new KeyEventHandler(this.Frm_XuatBan_KeyDown);
            base.Load += new EventHandler(this.Frm_XuatBan_Load);
            List<WeakReference> list = __ENCList;
            lock (list)
            {
                __ENCList.Add(new WeakReference(this));
            }
            this.mLoaiChungTu = "GHHH";
            this.objSoCT = new clsSoChungTu();
            this.cFrmKhoa = "";
            this.cFrmKhoaOld = "";
            this.objHH = new clsDMHangHoa();
            this.objDVT = new clsDMDonViTinh();
            this.objHD = new clsXuatKho();
            this.objHDHH = new clsXuatKhoChiTiet();
            this.objHDDV = new clsHoaDonChiTietDichVu();
            this.cFrmGhiSo = 0;
            this.ObjLT = new clsDMLoaiTien();
            this.cFrmTask = "";
            this.InitializeComponent();
        }

        private void AdvKhachHang_ValueChanged(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString() != "")
            {
                clsDMDoiTuong tuong = new clsDMDoiTuong();
                tuong.Load(this.AdvKhachHang.Value);
                if (tuong.KhoaLoaiGia.Trim() != "")
                {
                    this.CboLoaiGia.SelectedValue = tuong.KhoaLoaiGia;
                }
                else
                {
                    this.CboLoaiGia.SelectedValue = modGeneral.H_GIACHUAN;
                }
                this.CboDiaChiGiaoHang.Text = tuong.DiaChiGiaoHang;
                this.CboLienHe.DataSource = tuong.GetContactor(tuong.Khoa);
                this.CboLienHe.ValueMember = "Khoa";
                this.CboLienHe.DisplayMember = "Ten";
                if (this.CboLienHe.Items.Count >= 1)
                {
                    this.CboLienHe.SelectedIndex = 0;
                }
                DataTable listDiaChiGiaoHang = tuong.GetListDiaChiGiaoHang(this.AdvKhachHang.Value);
                int num = 0;
                this.CboDiaChiGiaoHang.Items.Clear();
                if (listDiaChiGiaoHang.Rows.Count > 0)
                {
                    int num2 = listDiaChiGiaoHang.Rows.Count - 1;
                    for (num = 0; num <= num2; num++)
                    {
                        this.CboDiaChiGiaoHang.Items.Add(RuntimeHelpers.GetObjectValue(listDiaChiGiaoHang.Rows[num][1]));
                    }
                }
                if (modGeneral.H_LANGUAGE == "VIET")
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất h\x00e0ng cho", "") + " " + tuong.TenViet.Trim();
                }
                else
                {
                    this.TxtDienGiai.Text = modGeneral.Tranlated("Xuất h\x00e0ng cho", "") + " " + tuong.TenAnh.Trim();
                }
            }
        }

        private void CboLoaiTien_SelectedIndexChanged(object sender, EventArgs e)
        {
            string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
            if (strCode != "")
            {
                this.ObjLT.LoadByCode(strCode);
                if (this.ObjLT.SoLe > 0)
                {
                    this.cFrmFormat = modGeneral.H_FORMATNUMBER + "." + LVYModule.sRight("0000000000", this.ObjLT.SoLe);
                }
                else
                {
                    this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                }
                this.FormatNumber();
            }
        }

        public bool CheckGrid()
        {
            int num2 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num2; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa phải chọn kho để xuất h\x00e0ng ", "") + ":" + LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString());
                    this.VSHangHoa.Select(i, 1);
                    this.VSHangHoa.Focus();
                    return false;
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x17]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.objHH.Load(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (this.objHH.KhoaTKHangHoa.Trim() == "")
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa định nghĩa t\x00e0i khoản h\x00e0ng h\x00f3a cho mặt h\x00e0ng", "") + ":" + LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString());
                        return false;
                    }
                    this.VSHangHoa[i, 0x16] = this.objHH.KhoaTKHangHoa;
                }
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x19]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.objHH.Load(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (this.objHH.KhoaTKGiaVon.Trim() == "")
                    {
                        LVYModule.ShowWarning(modGeneral.Tranlated("Bạn chưa định nghĩa t\x00e0i khoản gi\x00e1 vốn cho mặt h\x00e0ng", "") + ":" + LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 5]), "", modGeneral.TypeOfValue.Nothing).ToString());
                        return false;
                    }
                    this.VSHangHoa[i, 0x18] = this.objHH.KhoaTKGiaVon;
                }
            }
            return true;
        }

        public bool CheckIvalid()
        {
            if (!LVYModule.CheckDateLock(LVYModule.Date2Char(this.TxtNgayChungTu.Text)))
            {
                return false;
            }
            if (LVYModule.ReturnIfNull(this.TxtSoChungTu.Text, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập số chứng từ!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objHD.IsDuplicateVoucherNo(this.TxtSoChungTu.Text.Trim(), this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn phải nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (this.objHD.IsDuplicateVoucherNo(this.TxtSoChungTu.Text, this.cFrmKhoa))
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Số chứng từ n\x00e0y đ\x00e3 tồn tại, bạn h\x00e3y nhập số chứng từ kh\x00e1c!", ""));
                this.TxtSoChungTu.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải nhập kh\x00e1ch h\x00e0ng mua h\x00e0ng!", ""));
                this.AdvKhachHang.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
                return false;
            }
            if (LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn vui l\x00f2ng nhập số t\x00e0i khoản thanh to\x00e1n!", ""));
                this.AdvTaiKhoanChu.Focus();
                return false;
            }
            if (!this.CheckGrid())
            {
                return false;
            }
            return true;
        }

        private void CKChietKhauTheoHD_CheckedChanged(object sender, EventArgs e)
        {
            if (this.CKChietKhauTheoHD.Checked)
            {
                int num2 = this.VSHangHoa.Rows.Count - 1;
                int row = 1;
                while (row <= num2)
                {
                    this.VSHangHoa[row, 0x12] = 0;
                    this.VSHangHoa[row, 20] = 0;
                    row++;
                }
                RowColEventArgs args = new RowColEventArgs(row, 0x12);
                this.VSHangHoa_AfterEdit(this, args);
                this.TxtThueSuat.ReadOnly = false;
                this.TxtTienThueNT.ReadOnly = false;
                this.TxtTyLeChietKhau.ReadOnly = false;
                this.TxtChietKhauNT.ReadOnly = false;
            }
            else
            {
                this.TxtThueSuat.Value = 0;
                this.TxtThueSuat.ReadOnly = true;
                this.TxtTienThueNT.Value = 0;
                this.TxtTienThueNT.ReadOnly = true;
                this.TxtTyLeChietKhau.Value = 0;
                this.TxtTyLeChietKhau.ReadOnly = true;
                this.TxtChietKhauNT.Value = 0;
                this.TxtChietKhauNT.ReadOnly = true;
            }
            this.TinhTong();
        }

        private void CmdAdd_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.Trim() != "")
            {
                this.cFrmKhoaOld = this.cFrmKhoa;
            }
            this.EmptyData();
            this.cFrmKhoa = modGeneral.CreatKey("ST_XuatKho", 15, "GH");
            this.CboLoaiTien.SelectedValue = LVYModule.ReturnIfNull(modGeneral.H_CURRENCY, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            this.EnabledControl = true;
            this.TxtNgayChungTu.Focus();
            this.AdvTaiKhoanChu.SetDefault();
            this.CboLoaiDuLieu.SelectedValue = "NB";
        }

        private void CmdAddRow_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.AdvKhachHang.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn kh\x00e1ch h\x00e0ng trước!", ""));
                this.AdvKhachHang.Focus();
            }
            else if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim() == "")
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn phải chọn loại tiền!", ""));
                this.CboLoaiTien.Focus();
            }
            else
            {
                this.cFrmTask = "I";
                if (this.C1DockingTab1.SelectedIndex == 0)
                {
                    int num3;
                    if (this.VSHangHoa.Rows.Count > 1)
                    {
                        int num2 = this.VSHangHoa.Rows.Count - 1;
                        if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[num2, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                        {
                            return;
                        }
                    }
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = "HB";
                    int num = 12;
                    do
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, num] = 0;
                        num++;
                        num3 = 0x15;
                    }
                    while (num <= num3);
                    if (vSHangHoa.Rows.Count > 2)
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(vSHangHoa[vSHangHoa.Rows.Count - 2, 1]);
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(vSHangHoa[vSHangHoa.Rows.Count - 2, 2]);
                    }
                    else if (LVYModule.ReturnIfNull(modGeneral.H_STOCKID, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = modGeneral.H_STOCKID;
                    }
                    vSHangHoa.Select(this.VSHangHoa.Rows.Count - 1, 2);
                    vSHangHoa.Focus();
                    if (!modGeneral.H_GIABANBAOGOMTHUE)
                    {
                        vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value);
                    }
                    vSHangHoa = null;
                    if ((this.VSHangHoa.Rows.Count > 2) & (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[this.VSHangHoa.Rows.Count - 1, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != ""))
                    {
                        RowColEventArgs args = new RowColEventArgs(this.VSHangHoa.Rows.Count - 1, 4);
                        this.VSHangHoa_CellButtonClick(this, args);
                    }
                }
            }
        }

        private void CmdDel_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                if (this.objHD.DaXuatHoaDon(this.cFrmKhoa))
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Phiếu giao h\x00e0ng đ\x00e3 được xuất h\x00f3a đơn. Bạn kh\x00f4ng thể x\x00f3a!", ""));
                }
                else if (LVYModule.ConfirmDelete("") && this.objHD.DeleteData(this.cFrmKhoa, 1))
                {
                    this.EmptyData();
                    this.EnabledControl = false;
                }
            }
        }

        private void CmdDelRow_Click(object sender, EventArgs e)
        {
            if (this.VSHangHoa.Rows.Count != 1)
            {
                this.VSHangHoa.RemoveItem(this.VSHangHoa.Row);
            }
        }

        private void CmdEdit_Click(object sender, EventArgs e)
        {
            if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
            {
                this.objHD.Load(this.cFrmKhoa);
                if (this.objHD.DaXuatHoaDon(this.cFrmKhoa))
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Phiếu giao h\x00e0ng đ\x00e3 được xuất h\x00f3a đơn. Bạn kh\x00f4ng thể sửa!", ""));
                }
                else
                {
                    this.cFrmKhoaOld = this.cFrmKhoa;
                    this.cFrmTask = "U";
                    this.EnabledControl = true;
                }
            }
        }

        private void CmdExit_Click(object sender, EventArgs e)
        {
            this.Dispose();
        }

        private void CmdFind_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_PhieuGiaoHangList.Show();
            MyProject.Forms.Frm_PhieuGiaoHangList.BringToFront();
        }

        private void cmdPhieuXuat_Click(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintPhieuGiaoHang(this.cFrmKhoa, "VIET");
            }
        }

        private void CmdPrint_ButtonClick(object sender, EventArgs e)
        {
            if (this.cFrmKhoa.ToString().Trim() != "")
            {
                ReportModule.PrintPhieuGiaoHang(this.cFrmKhoa, modGeneral.H_LANGUAGE);
            }
        }

        private void CmdPrint_Click(object sender, EventArgs e)
        {
        }

        private void CmdPrintBienBan_Click(object sender, EventArgs e)
        {
            clsXuatKho kho = new clsXuatKho();
            clsDMDoiTuong tuong = new clsDMDoiTuong();
            clsDMLoaiTien tien = new clsDMLoaiTien();
            if (Form.ActiveForm != null)
            {
                Form.ActiveForm.Cursor = Cursors.WaitCursor;
            }
            kho.Load(this.cFrmKhoa);
            tuong.Load(kho.KhoaNhanVienGiaoHang);
            tien.LoadByCode(kho.LoaiTien.Trim());
            string nguoiGiao = kho.NguoiGiao;
            DataTable dataPrintBienBan = kho.GetDataPrintBienBan(this.cFrmKhoa, "VIET");
            string str2 = (modGeneral.Tranlated("tại", "") + " " + kho.DiaChiGiaoHang) + ", " + modGeneral.Tranlated("hai b\x00ean thống nhất k\x00fd kết bi\x00ean bản giao nhận h\x00e0ng với nội dung như sau", "") + ":";
            if (dataPrintBienBan.Rows.Count == 0)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Kh\x00f4ng c\x00f3 dữ liệu !", ""));
            }
            else
            {
                Rpt_BienBanGiaoHang hang = new Rpt_BienBanGiaoHang();
                try
                {
                    hang.SetDataSource(dataPrintBienBan);
                    hang.Subreports[0].SetDataSource(modGeneral.H_DATACOMPANY);
                    if (modGeneral.H_LANGUAGE == "VIET")
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEVIET, ""));
                    }
                    else
                    {
                        hang.SetParameterValue(0, modGeneral.Tranlated(modGeneral.H_COMPANYNAMEANH, ""));
                    }
                    hang.SetParameterValue(1, modGeneral.H_ADDRESS);
                    hang.SetParameterValue(2, modGeneral.H_TAXCODE);
                    hang.SetParameterValue(3, modGeneral.Tranlated("Điện thoại", "") + ": " + modGeneral.H_TELEPHONE);
                    hang.SetParameterValue(4, modGeneral.Tranlated("Fax", "") + ": " + modGeneral.H_FAX);
                    hang.SetParameterValue(5, modGeneral.Tranlated("H\x00f4m nay", "") + " " + LVYModule.DateLetter(LVYModule.Char2Date(kho.NgayChungTu), "VIET") + ", " + str2);
                    hang.SetParameterValue(6, modGeneral.Tranlated("Bi\x00ean bản n\x00e0y được lập th\x00e0nh 02 bản c\x00f3 gi\x00e1 trị ph\x00e1p l\x00fd như nhau, mỗi b\x00ean giữ một bản.", ""));
                    hang.SetParameterValue(7, tuong.TenViet.ToUpper());
                    string str4 = "";
                    if (Strings.InStr(nguoiGiao, "-", CompareMethod.Binary) != 0)
                    {
                        str4 = "-";
                    }
                    if (Strings.InStr(nguoiGiao, "/", CompareMethod.Binary) != 0)
                    {
                        str4 = "/";
                    }
                    if (str4.Trim() != "")
                    {
                        nguoiGiao = NewLateBinding.LateIndexGet(nguoiGiao.Split(new char[] { Conversions.ToChar(str4) }), new object[] { 0 }, null).ToString();
                    }
                    hang.SetParameterValue(8, nguoiGiao.ToUpper());
                    hang.SetParameterValue(9, modGeneral.H_TELEPHONE);
                    MyProject.Forms.Frm_ViewReport.ReportViewer.ReportSource = hang;
                    MyProject.Forms.Frm_ViewReport.ReportViewer.DisplayGroupTree = false;
                    this.Cursor = Cursors.Default;
                    MyProject.Forms.Frm_ViewReport.ShowDialog();
                }
                catch (Exception exception1)
                {
                    ProjectData.SetProjectError(exception1);
                    Exception exception = exception1;
                    MessageBox.Show(exception.Message.ToString());
                    ProjectData.ClearProjectError();
                }
            }
        }

        private void cmdPrintEN_Click(object sender, EventArgs e)
        {
            ReportModule.PrintPhieuGiaoHang(this.cFrmKhoa, "ANH");
        }

        private void CmdSave_Click(object sender, EventArgs e)
        {
            if (this.CheckIvalid())
            {
                if (!this.SaveHHDetailsTemp())
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                }
                else if (Conversions.ToBoolean(Microsoft.VisualBasic.CompilerServices.Operators.NotObject(this.UpdateData())))
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                }
                else
                {
                    this.objHD.ClearTemp(this.cFrmKhoa);
                    this.EnabledControl = false;
                    this.cFrmTask = "";
                }
            }
        }

        private void cmdTimDonHang_Click(object sender, EventArgs e)
        {
            Rectangle displayRectangle = this.cmdTimDonHang.DisplayRectangle;
            displayRectangle = this.cmdTimDonHang.RectangleToScreen(displayRectangle);
            Point point = new Point(displayRectangle.Left, displayRectangle.Bottom);
            object obj2 = point;
            object[] objArray = new object[2];
            object instance = obj2;
            objArray[0] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(instance, null, "X", new object[0], null, null, null));
            object obj4 = obj2;
            objArray[1] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateGet(obj4, null, "Y", new object[0], null, null, null));
            object[] arguments = objArray;
            bool[] copyBack = new bool[] { true, true };
            NewLateBinding.LateCall(this.mnChungTuGoc, null, "Show", arguments, null, null, copyBack, true);
            if (copyBack[0])
            {
                NewLateBinding.LateSetComplex(instance, null, "X", new object[] { RuntimeHelpers.GetObjectValue(arguments[0]) }, null, null, true, false);
            }
            if (copyBack[1])
            {
                NewLateBinding.LateSetComplex(obj4, null, "Y", new object[] { RuntimeHelpers.GetObjectValue(arguments[1]) }, null, null, true, false);
            }
        }

        private void CmdTimDuAn_Click(object sender, EventArgs e)
        {
            string expression = SearchModule.SearchProduct("");
            if (expression != "")
            {
                object instance = Strings.Split(expression, "|", -1, CompareMethod.Binary);
                this.TxtDuAn.Tag = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                this.TxtDuAn.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
            }
        }

        private void CmdUnsave_Click(object sender, EventArgs e)
        {
            this.EnabledControl = false;
            this.EmptyData();
            if (this.cFrmTask == "I")
            {
                this.objSoCT.UndoVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
            }
            this.cFrmTask = "";
        }

        [DebuggerNonUserCode]
        protected override void Dispose(bool disposing)
        {
            if (disposing && (this.components != null))
            {
                this.components.Dispose();
            }
            base.Dispose(disposing);
        }

        public void EmptyData()
        {
            this.TxtSoChungTu.Text = "";
            this.TxtNgayChungTu.Text = Strings.Format(DateAndTime.Today, "dd/MM/yyyy");
            this.CboLoaiTien.SelectedValue = "";
            this.TxtDienGiai.Text = "";
            this.AdvNhanVien.Value = "";
            this.AdvKhachHang.Value = "";
            this.VSHangHoa.Select(0, 0);
            this.VSHangHoa.Rows.Count = 1;
            this.CboLoaiGia.SelectedValue = "";
            this.TxtTongThanhToanNT.Value = 0;
        }

        public void FormatNumber()
        {
            LVYModule.advFormatNumber(this.TxtTienHangNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTienThueNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtTongThanhToanNT, this.cFrmFormat);
            LVYModule.advFormatNumber(this.TxtChietKhauNT, this.cFrmFormat);
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            vSHangHoa.Cols[0x10].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x11].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x13].Format = this.cFrmFormat;
            vSHangHoa.Cols[0x15].Format = this.cFrmFormat;
            vSHangHoa = null;
        }

        private void Frm_XuatBan_KeyDown(object sender, KeyEventArgs e)
        {
            Keys keyCode = e.KeyCode;
            if (keyCode == Keys.Escape)
            {
                if (this.CmdExit.Enabled)
                {
                    this.CmdExit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F2)
            {
                if (this.CmdEdit.Enabled)
                {
                    this.CmdEdit_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F3)
            {
                this.CmdFind_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
            else if (keyCode == Keys.F5)
            {
                this.C1DockingTab1.SelectedIndex = 0;
            }
            else if (keyCode == Keys.F6)
            {
                this.C1DockingTab2.SelectedIndex = 1;
            }
            else if (keyCode == Keys.F8)
            {
                if (this.CmdAdd.Enabled)
                {
                    this.CmdAdd_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F9)
            {
                if (this.CmdDel.Enabled)
                {
                    this.CmdDel_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F10)
            {
                if (this.CmdSave.Enabled)
                {
                    this.CmdSave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if (keyCode == Keys.F11)
            {
                if (this.CmdUnsave.Enabled)
                {
                    this.CmdUnsave_Click(RuntimeHelpers.GetObjectValue(sender), e);
                }
            }
            else if ((keyCode == Keys.F12) && this.CmdPrint.Enabled)
            {
                this.CmdPrint_Click(RuntimeHelpers.GetObjectValue(sender), e);
            }
        }

        private void Frm_XuatBan_Load(object sender, EventArgs e)
        {
            this.Cursor = Cursors.WaitCursor;
            LVYModule.GetUserRight(ref this.mAllowView, ref this.mAllowDel, ref this.mAllowEdit, ref this.mAllowAdd, Conversions.ToString(this.Tag), modGeneral.H_USERNAME);
            if (!this.mAllowView)
            {
                LVYModule.ShowWarning(modGeneral.Tranlated("Bạn kh\x00f4ng c\x00f3 quyền xem, li\x00ean hệ với người quản trị để biết th\x00eam chi tiết.", ""));
                this.Dispose();
            }
            else
            {
                this.EnabledControl = false;
                this.cFrmFormat = modGeneral.H_FORMATNUMBER;
                BuildComboModule.BuildCombo(this.CboLoaiTien, modGeneral.ListDanhMuc.LoaiTien, false, "", "");
                BuildComboModule.BuildCombo(this.CboLoaiGia, modGeneral.ListDanhMuc.LoaiGiaBan, false, "", "");
                this.CKTachThue.Checked = modGeneral.H_GIABANBAOGOMTHUE;
                BuildComboModule.InitComboDatatype(this.CboLoaiDuLieu);
                this.PNDungChung.Visible = modGeneral.H_KETHOPDULIEUTHUE;
                if (LVYModule.ReturnIfNull(this.cFrmKhoa, "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                {
                    this.EmptyData();
                }
                else
                {
                    this.ShowData(this.cFrmKhoa);
                }
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                vSHangHoa.Cols[1].DataMap = LVYModule.MapDataDanhMuc(modGeneral.ListDanhMuc.KhoHang);
                Hashtable hashtable = new Hashtable();
                hashtable.Add("HB", "H\x00e0ng b\x00e1n");
                hashtable.Add("KM", "Khuyến m\x00e3i");
                hashtable.Add("DV", "Dịch vụ");
                vSHangHoa.Cols[2].DataMap = hashtable;
                vSHangHoa.Cols[6].Visible = modGeneral.H_THEODOISOLOHANG;
                vSHangHoa.Cols[7].Visible = modGeneral.H_THEODOISERIALKHIXUAT;
                vSHangHoa.Cols[9].Visible = modGeneral.H_THEODOIHANDUNG;
                vSHangHoa.Cols[13].Editor = this.TxtSoLuong;
                vSHangHoa = null;
                this.Cursor = Cursors.Default;
            }
        }

        public void GetGiaBanCoThue()
        {
            int row = 0;
            string pKhoa = "";
            int num5 = this.VSHangHoa.Rows.Count - 1;
            for (row = 1; row <= num5; row++)
            {
                RowColEventArgs e = new RowColEventArgs(row, 0x10);
                pKhoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                if (pKhoa.Trim() == "")
                {
                    break;
                }
                this.objHH.Load(pKhoa);
                this.objHH.LoadGiaBan(pKhoa, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim());
                this.VSHangHoa[row, 0x10] = this.objHH.GiaBan;
                this.VSHangHoa[row, 20] = 0;
                this.VSHangHoa_AfterEdit(this, e);
            }
        }

        public void GetGiaVon(int nRow)
        {
            clsDMHangHoa hoa = new clsDMHangHoa();
            string pKhoaHangHoa = "";
            string pKhoaKho = "";
            string pSoSeri = "";
            pKhoaHangHoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            if (pKhoaHangHoa != "")
            {
                pKhoaKho = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                pSoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[nRow, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                hoa.LoadTonKho(pKhoaHangHoa, pKhoaKho, "", "", "", "", pSoSeri, LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6));
                if (hoa.SoLuongTonKho == 0.0)
                {
                    LVYModule.ShowWarning(modGeneral.Tranlated("Kho kh\x00f4ng đủ h\x00e0ng xuất!", ""));
                }
                else
                {
                    this.VSHangHoa[nRow, 14] = hoa.TriGiaTonKho / hoa.SoLuongTonKho;
                }
            }
        }

        [DebuggerStepThrough]
        private void InitializeComponent()
        {
            this.components = new System.ComponentModel.Container();
            ComponentResourceManager manager = new ComponentResourceManager(typeof(Frm_PhieuGiaoHang));
            this.CKTachThue = new CheckBox();
            this.TxtDienThoai = new TextBox();
            this.Label34 = new Label();
            this.TxtGhiChuGiaoHang = new TextBox();
            this.Label29 = new Label();
            this.CboLienHe = new ComboBox();
            this.Label7 = new Label();
            this.Label2 = new Label();
            this.AdvTaiKhoanChu = new ADVAccount();
            this.CboDiaChiGiaoHang = new ComboBox();
            this.Label28 = new Label();
            this.AdvGiaoNhan = new ADVObjects();
            this.Label25 = new Label();
            this.CboLoaiGia = new ComboBox();
            this.Label19 = new Label();
            this.AdvNhanVien = new ADVObjects();
            this.Label16 = new Label();
            this.AdvKhachHang = new ADVObjects();
            this.cmdTimDonHang = new Button();
            this.Label4 = new Label();
            this.TxtNgayDathang = new DateTimePicker();
            this.Label6 = new Label();
            this.TxtSoDonHang = new TextBox();
            this.TxtDienGiai = new TextBox();
            this.Label9 = new Label();
            this.Label3 = new Label();
            this.CboLoaiTien = new ComboBox();
            this.Label11 = new Label();
            this.Label13 = new Label();
            this.TxtNgayChungTu = new DateTimePicker();
            this.Label1 = new Label();
            this.TxtSoChungTu = new TextBox();
            this.ImageList1 = new ImageList(this.components);
            this.Panel4 = new Panel();
            this.TxtTienVonNT = new C1NumericEdit();
            this.TxtSoLuong = new C1NumericEdit();
            this.CKChietKhauTheoHD = new CheckBox();
            this.CmdDelRow = new Button();
            this.CmdAddRow = new Button();
            this.Panel5 = new Panel();
            this.TxtTyLeChietKhau = new C1NumericEdit();
            this.TxtThueSuat = new C1NumericEdit();
            this.TxtTongThanhToanNT = new C1NumericEdit();
            this.Label23 = new Label();
            this.TxtTienThueNT = new C1NumericEdit();
            this.TxtTienHangNT = new C1NumericEdit();
            this.TxtChietKhauNT = new C1NumericEdit();
            this.Label22 = new Label();
            this.Label21 = new Label();
            this.Label5 = new Label();
            this.mnChungTuGoc = new ContextMenuStrip(this.components);
            this.mnDonHang = new ToolStripMenuItem();
            this.mnBaoGia = new ToolStripMenuItem();
            this.ToolStrip1 = new ToolStrip();
            this.CmdAdd = new ToolStripButton();
            this.CmdEdit = new ToolStripButton();
            this.ToolStripSeparator2 = new ToolStripSeparator();
            this.CmdSave = new ToolStripButton();
            this.CmdUnsave = new ToolStripButton();
            this.ToolStripSeparator1 = new ToolStripSeparator();
            this.CmdFind = new ToolStripButton();
            this.CmdPrint = new ToolStripSplitButton();
            this.cmdPrintVI = new ToolStripMenuItem();
            this.cmdPrintEN = new ToolStripMenuItem();
            this.ToolStripButton1 = new ToolStripSeparator();
            this.CmdDel = new ToolStripButton();
            this.ToolStripSeparator3 = new ToolStripSeparator();
            this.CmdExit = new ToolStripButton();
            this.ToolStripButton2 = new ToolStripButton();
            this.CmdPrintBienBan = new ToolStripButton();
            this.PNDungChung = new Panel();
            this.CmdChuyen = new Button();
            this.CboLoaiDuLieu = new ComboBox();
            this.CmdTimDuAn = new Button();
            this.Label33 = new Label();
            this.TxtDuAn = new TextBox();
            this.C1DockingTab1 = new C1DockingTab();
            this.C1DockingTabPage1 = new C1DockingTabPage();
            this.VSHangHoa = new C1.Win.C1FlexGrid.C1FlexGrid();
            this.C1DockingTab2 = new C1DockingTab();
            this.C1DockingTabPage2 = new C1DockingTabPage();
            this.Panel4.SuspendLayout();
            ((ISupportInitialize) this.TxtTienVonNT).BeginInit();
            ((ISupportInitialize) this.TxtSoLuong).BeginInit();
            this.Panel5.SuspendLayout();
            ((ISupportInitialize) this.TxtTyLeChietKhau).BeginInit();
            ((ISupportInitialize) this.TxtThueSuat).BeginInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).BeginInit();
            ((ISupportInitialize) this.TxtTienThueNT).BeginInit();
            ((ISupportInitialize) this.TxtTienHangNT).BeginInit();
            ((ISupportInitialize) this.TxtChietKhauNT).BeginInit();
            this.mnChungTuGoc.SuspendLayout();
            this.ToolStrip1.SuspendLayout();
            this.PNDungChung.SuspendLayout();
            ((ISupportInitialize) this.C1DockingTab1).BeginInit();
            this.C1DockingTab1.SuspendLayout();
            this.C1DockingTabPage1.SuspendLayout();
            this.VSHangHoa.BeginInit();
            ((ISupportInitialize) this.C1DockingTab2).BeginInit();
            this.C1DockingTab2.SuspendLayout();
            this.C1DockingTabPage2.SuspendLayout();
            this.SuspendLayout();
            this.CKTachThue.AutoSize = true;
            this.CKTachThue.Checked = true;
            this.CKTachThue.CheckState = CheckState.Checked;
            Point point = new Point(0xc1, 0x7f);
            this.CKTachThue.Location = point;
            this.CKTachThue.Name = "CKTachThue";
            Size size = new Size(0x7d, 0x11);
            this.CKTachThue.Size = size;
            this.CKTachThue.TabIndex = 0x15;
            this.CKTachThue.Text = "T\x00e1ch thuế từ gi\x00e1 b\x00e1n";
            this.CKTachThue.UseVisualStyleBackColor = true;
            point = new Point(0x13a, 0x3e);
            this.TxtDienThoai.Location = point;
            this.TxtDienThoai.Name = "TxtDienThoai";
            size = new Size(0x63, 20);
            this.TxtDienThoai.Size = size;
            this.TxtDienThoai.TabIndex = 10;
            this.Label34.AutoSize = true;
            this.Label34.BackColor = Color.Transparent;
            point = new Point(0x103, 0x42);
            this.Label34.Location = point;
            this.Label34.Name = "Label34";
            size = new Size(0x37, 13);
            this.Label34.Size = size;
            this.Label34.TabIndex = 13;
            this.Label34.Text = "Điện thoại";
            point = new Point(0x214, 0x55);
            this.TxtGhiChuGiaoHang.Location = point;
            this.TxtGhiChuGiaoHang.Name = "TxtGhiChuGiaoHang";
            size = new Size(0x14e, 20);
            this.TxtGhiChuGiaoHang.Size = size;
            this.TxtGhiChuGiaoHang.TabIndex = 0x12;
            this.Label29.AutoEllipsis = true;
            this.Label29.AutoSize = true;
            this.Label29.BackColor = Color.Transparent;
            point = new Point(0x1b2, 0x57);
            this.Label29.Location = point;
            this.Label29.Name = "Label29";
            this.Label29.RightToLeft = RightToLeft.No;
            size = new Size(0x5e, 13);
            this.Label29.Size = size;
            this.Label29.TabIndex = 0x1b;
            this.Label29.Text = "Ghi ch\x00fa giao h\x00e0ng";
            this.Label29.TextAlign = ContentAlignment.TopRight;
            this.CboLienHe.FormattingEnabled = true;
            point = new Point(0x5c, 0x3e);
            this.CboLienHe.Location = point;
            this.CboLienHe.Name = "CboLienHe";
            size = new Size(0xa6, 0x15);
            this.CboLienHe.Size = size;
            this.CboLienHe.TabIndex = 9;
            this.Label7.AutoEllipsis = true;
            this.Label7.AutoSize = true;
            this.Label7.BackColor = Color.Transparent;
            point = new Point(7, 0x42);
            this.Label7.Location = point;
            this.Label7.Name = "Label7";
            this.Label7.RightToLeft = RightToLeft.No;
            size = new Size(0x2a, 13);
            this.Label7.Size = size;
            this.Label7.TabIndex = 11;
            this.Label7.Text = "Li\x00ean hệ";
            this.Label7.TextAlign = ContentAlignment.TopRight;
            this.Label2.AutoSize = true;
            this.Label2.BackColor = Color.Transparent;
            point = new Point(0x1b2, 0x70);
            this.Label2.Location = point;
            this.Label2.Name = "Label2";
            size = new Size(70, 13);
            this.Label2.Size = size;
            this.Label2.TabIndex = 0x1d;
            this.Label2.Text = "T\x00e0i khoản nợ";
            this.AdvTaiKhoanChu.Conditions = "";
            this.AdvTaiKhoanChu.DefaultValue = "157";
            this.AdvTaiKhoanChu.FieldNameFilter = "Left(SoTaiKhoan,2)";
            this.AdvTaiKhoanChu.KeyFilter = "15";
            point = new Point(0x214, 110);
            this.AdvTaiKhoanChu.Location = point;
            Padding padding = new Padding(0);
            this.AdvTaiKhoanChu.Margin = padding;
            this.AdvTaiKhoanChu.Name = "AdvTaiKhoanChu";
            this.AdvTaiKhoanChu.OnlyDigit = false;
            this.AdvTaiKhoanChu.ReadOnly = false;
            size = new Size(0x14e, 20);
            this.AdvTaiKhoanChu.Size = size;
            this.AdvTaiKhoanChu.TabIndex = 0x13;
            this.AdvTaiKhoanChu.UpperText = true;
            this.AdvTaiKhoanChu.Value = "";
            this.AdvTaiKhoanChu.WithCode = 80;
            this.CboDiaChiGiaoHang.FormattingEnabled = true;
            point = new Point(0x214, 60);
            this.CboDiaChiGiaoHang.Location = point;
            this.CboDiaChiGiaoHang.Name = "CboDiaChiGiaoHang";
            size = new Size(0x14e, 0x15);
            this.CboDiaChiGiaoHang.Size = size;
            this.CboDiaChiGiaoHang.TabIndex = 0x11;
            this.Label28.AutoSize = true;
            this.Label28.BackColor = Color.Transparent;
            point = new Point(0x1b2, 0x3f);
            this.Label28.Location = point;
            this.Label28.Name = "Label28";
            size = new Size(90, 13);
            this.Label28.Size = size;
            this.Label28.TabIndex = 0x19;
            this.Label28.Text = "Địa chỉ giao h\x00e0ng";
            this.Label28.TextAlign = ContentAlignment.TopRight;
            this.AdvGiaoNhan.Conditions = "";
            this.AdvGiaoNhan.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x214, 0x24);
            this.AdvGiaoNhan.Location = point;
            this.AdvGiaoNhan.Name = "AdvGiaoNhan";
            this.AdvGiaoNhan.ReadOnly = false;
            size = new Size(0x14e, 20);
            this.AdvGiaoNhan.Size = size;
            this.AdvGiaoNhan.TabIndex = 0x10;
            this.AdvGiaoNhan.UpperText = true;
            this.AdvGiaoNhan.Value = "";
            this.AdvGiaoNhan.WidthCode = 80;
            this.Label25.AutoEllipsis = true;
            this.Label25.AutoSize = true;
            this.Label25.BackColor = Color.Transparent;
            point = new Point(0x1b2, 0x26);
            this.Label25.Location = point;
            this.Label25.Name = "Label25";
            this.Label25.RightToLeft = RightToLeft.No;
            size = new Size(0x38, 13);
            this.Label25.Size = size;
            this.Label25.TabIndex = 0x17;
            this.Label25.Text = "Giao nhận";
            this.Label25.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiGia.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiGia.FormattingEnabled = true;
            point = new Point(0x5c, 0x56);
            this.CboLoaiGia.Location = point;
            this.CboLoaiGia.Name = "CboLoaiGia";
            size = new Size(0xa6, 0x15);
            this.CboLoaiGia.Size = size;
            this.CboLoaiGia.TabIndex = 11;
            this.Label19.AutoSize = true;
            this.Label19.BackColor = Color.Transparent;
            point = new Point(7, 90);
            this.Label19.Location = point;
            this.Label19.Name = "Label19";
            size = new Size(0x2c, 13);
            this.Label19.Size = size;
            this.Label19.TabIndex = 15;
            this.Label19.Text = "Loại gi\x00e1";
            this.Label19.TextAlign = ContentAlignment.TopRight;
            this.AdvNhanVien.Conditions = "";
            this.AdvNhanVien.LoaiDoiTuong = modGeneral.TypeObjects.NhanVien;
            point = new Point(0x214, 12);
            this.AdvNhanVien.Location = point;
            this.AdvNhanVien.Name = "AdvNhanVien";
            this.AdvNhanVien.ReadOnly = false;
            size = new Size(0x14e, 20);
            this.AdvNhanVien.Size = size;
            this.AdvNhanVien.TabIndex = 14;
            this.AdvNhanVien.UpperText = true;
            this.AdvNhanVien.Value = "";
            this.AdvNhanVien.WidthCode = 80;
            this.Label16.AutoEllipsis = true;
            this.Label16.AutoSize = true;
            this.Label16.BackColor = Color.Transparent;
            point = new Point(8, 0x29);
            this.Label16.Location = point;
            this.Label16.Name = "Label16";
            this.Label16.RightToLeft = RightToLeft.No;
            size = new Size(0x41, 13);
            this.Label16.Size = size;
            this.Label16.TabIndex = 9;
            this.Label16.Text = "Kh\x00e1ch h\x00e0ng";
            this.Label16.TextAlign = ContentAlignment.TopRight;
            this.AdvKhachHang.Conditions = "";
            this.AdvKhachHang.LoaiDoiTuong = modGeneral.TypeObjects.KhachHang;
            point = new Point(0x5c, 0x26);
            this.AdvKhachHang.Location = point;
            this.AdvKhachHang.Name = "AdvKhachHang";
            this.AdvKhachHang.ReadOnly = false;
            size = new Size(0x141, 20);
            this.AdvKhachHang.Size = size;
            this.AdvKhachHang.TabIndex = 8;
            this.AdvKhachHang.UpperText = true;
            this.AdvKhachHang.Value = "";
            this.AdvKhachHang.WidthCode = 80;
            this.cmdTimDonHang.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.cmdTimDonHang.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0x298, 0xe4);
            this.cmdTimDonHang.Location = point;
            padding = new Padding(0);
            this.cmdTimDonHang.Margin = padding;
            this.cmdTimDonHang.Name = "cmdTimDonHang";
            size = new Size(0x17, 0x16);
            this.cmdTimDonHang.Size = size;
            this.cmdTimDonHang.TabIndex = 2;
            this.cmdTimDonHang.UseVisualStyleBackColor = true;
            this.Label4.AutoSize = true;
            this.Label4.BackColor = Color.Transparent;
            point = new Point(0x2c7, 0xe8);
            this.Label4.Location = point;
            this.Label4.Name = "Label4";
            size = new Size(0x20, 13);
            this.Label4.Size = size;
            this.Label4.TabIndex = 3;
            this.Label4.Text = "Ng\x00e0y";
            this.TxtNgayDathang.Enabled = false;
            this.TxtNgayDathang.Format = DateTimePickerFormat.Custom;
            point = new Point(0x31d, 0xe5);
            this.TxtNgayDathang.Location = point;
            this.TxtNgayDathang.Name = "TxtNgayDathang";
            size = new Size(0x65, 20);
            this.TxtNgayDathang.Size = size;
            this.TxtNgayDathang.TabIndex = 4;
            this.Label6.AutoSize = true;
            this.Label6.BackColor = Color.Transparent;
            point = new Point(0x1ed, 0xe8);
            this.Label6.Location = point;
            this.Label6.Name = "Label6";
            size = new Size(0x44, 13);
            this.Label6.Size = size;
            this.Label6.TabIndex = 0;
            this.Label6.Text = "Đơn h\x00e0ng số";
            this.TxtSoDonHang.Enabled = false;
            point = new Point(0x241, 0xe5);
            this.TxtSoDonHang.Location = point;
            this.TxtSoDonHang.Name = "TxtSoDonHang";
            this.TxtSoDonHang.ReadOnly = true;
            size = new Size(0x56, 20);
            this.TxtSoDonHang.Size = size;
            this.TxtSoDonHang.TabIndex = 1;
            point = new Point(0x5b, 0x75);
            this.TxtDienGiai.Location = point;
            this.TxtDienGiai.Multiline = true;
            this.TxtDienGiai.Name = "TxtDienGiai";
            size = new Size(0x141, 0x22);
            this.TxtDienGiai.Size = size;
            this.TxtDienGiai.TabIndex = 13;
            this.Label9.AutoEllipsis = true;
            this.Label9.AutoSize = true;
            this.Label9.BackColor = Color.Transparent;
            point = new Point(3, 0x75);
            this.Label9.Location = point;
            this.Label9.Name = "Label9";
            this.Label9.RightToLeft = RightToLeft.No;
            size = new Size(0x30, 13);
            this.Label9.Size = size;
            this.Label9.TabIndex = 0x13;
            this.Label9.Text = "Diễn giải";
            this.Label9.TextAlign = ContentAlignment.TopRight;
            this.Label3.AutoEllipsis = true;
            this.Label3.AutoSize = true;
            this.Label3.BackColor = Color.Transparent;
            point = new Point(0x1b2, 0x10);
            this.Label3.Location = point;
            this.Label3.Name = "Label3";
            this.Label3.RightToLeft = RightToLeft.No;
            size = new Size(0x4d, 13);
            this.Label3.Size = size;
            this.Label3.TabIndex = 0x15;
            this.Label3.Text = "Nh\x00e2n vi\x00ean b\x00e1n";
            this.Label3.TextAlign = ContentAlignment.TopRight;
            this.CboLoaiTien.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiTien.FormattingEnabled = true;
            point = new Point(0x138, 0x56);
            this.CboLoaiTien.Location = point;
            this.CboLoaiTien.Name = "CboLoaiTien";
            size = new Size(100, 0x15);
            this.CboLoaiTien.Size = size;
            this.CboLoaiTien.TabIndex = 12;
            this.Label11.AutoSize = true;
            this.Label11.BackColor = Color.Transparent;
            point = new Point(0x106, 0x59);
            this.Label11.Location = point;
            this.Label11.Name = "Label11";
            size = new Size(0x2f, 13);
            this.Label11.Size = size;
            this.Label11.TabIndex = 0x11;
            this.Label11.Text = "Loại tiền";
            this.Label11.TextAlign = ContentAlignment.TopRight;
            this.Label13.AutoSize = true;
            this.Label13.BackColor = Color.Transparent;
            point = new Point(8, 0x12);
            this.Label13.Location = point;
            this.Label13.Name = "Label13";
            size = new Size(0x20, 13);
            this.Label13.Size = size;
            this.Label13.TabIndex = 5;
            this.Label13.Text = "Ng\x00e0y";
            this.TxtNgayChungTu.Format = DateTimePickerFormat.Custom;
            point = new Point(0x5c, 14);
            this.TxtNgayChungTu.Location = point;
            this.TxtNgayChungTu.Name = "TxtNgayChungTu";
            size = new Size(0x6c, 20);
            this.TxtNgayChungTu.Size = size;
            this.TxtNgayChungTu.TabIndex = 5;
            this.Label1.AutoSize = true;
            this.Label1.BackColor = Color.Transparent;
            point = new Point(0xe3, 0x11);
            this.Label1.Location = point;
            this.Label1.Name = "Label1";
            size = new Size(0x41, 13);
            this.Label1.Size = size;
            this.Label1.TabIndex = 6;
            this.Label1.Text = "Số chứng từ";
            point = new Point(0x138, 14);
            this.TxtSoChungTu.Location = point;
            this.TxtSoChungTu.Name = "TxtSoChungTu";
            size = new Size(0x65, 20);
            this.TxtSoChungTu.Size = size;
            this.TxtSoChungTu.TabIndex = 7;
            this.ImageList1.ImageStream = (ImageListStreamer) manager.GetObject("ImageList1.ImageStream");
            this.ImageList1.TransparentColor = Color.Transparent;
            this.ImageList1.Images.SetKeyName(0, "orders_main.png");
            this.ImageList1.Images.SetKeyName(1, "checkingacct.png");
            this.ImageList1.Images.SetKeyName(2, "billing.png");
            this.Panel4.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel4.BackgroundImageLayout = ImageLayout.Stretch;
            this.Panel4.Controls.Add(this.TxtTienVonNT);
            this.Panel4.Controls.Add(this.TxtSoLuong);
            this.Panel4.Controls.Add(this.CKChietKhauTheoHD);
            this.Panel4.Controls.Add(this.CKTachThue);
            this.Panel4.Controls.Add(this.CmdDelRow);
            this.Panel4.Controls.Add(this.CmdAddRow);
            this.Panel4.Controls.Add(this.Panel5);
            this.Panel4.Dock = DockStyle.Bottom;
            point = new Point(0, 0x1ff);
            this.Panel4.Location = point;
            this.Panel4.Name = "Panel4";
            size = new Size(0x37e, 0x4e);
            this.Panel4.Size = size;
            this.Panel4.TabIndex = 3;
            this.TxtTienVonNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienVonNT.DataType = typeof(double);
            this.TxtTienVonNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x19c, 0x97);
            this.TxtTienVonNT.Location = point;
            this.TxtTienVonNT.Name = "TxtTienVonNT";
            padding = new Padding(1);
            this.TxtTienVonNT.Padding = padding;
            this.TxtTienVonNT.ReadOnly = true;
            size = new Size(0x75, 20);
            this.TxtTienVonNT.Size = size;
            this.TxtTienVonNT.TabIndex = 0xa4;
            this.TxtTienVonNT.Tag = null;
            this.TxtTienVonNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienVonNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienVonNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienVonNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoLuong.BorderStyle = BorderStyle.FixedSingle;
            this.TxtSoLuong.DataType = typeof(double);
            this.TxtSoLuong.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x195, 0x52);
            this.TxtSoLuong.Location = point;
            this.TxtSoLuong.Name = "TxtSoLuong";
            padding = new Padding(1);
            this.TxtSoLuong.Padding = padding;
            size = new Size(0x55, 20);
            this.TxtSoLuong.Size = size;
            this.TxtSoLuong.TabIndex = 0xa3;
            this.TxtSoLuong.Tag = null;
            this.TxtSoLuong.TextAlign = HorizontalAlignment.Right;
            this.TxtSoLuong.VisibleButtons = DropDownControlButtonFlags.DropDown;
            this.TxtSoLuong.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtSoLuong.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.CKChietKhauTheoHD.AutoSize = true;
            point = new Point(0xc1, 0x63);
            this.CKChietKhauTheoHD.Location = point;
            this.CKChietKhauTheoHD.Name = "CKChietKhauTheoHD";
            size = new Size(0x99, 0x11);
            this.CKChietKhauTheoHD.Size = size;
            this.CKChietKhauTheoHD.TabIndex = 0x9e;
            this.CKChietKhauTheoHD.Text = "Chiết khấu theo tổng gi\x00e1 trị";
            this.CKChietKhauTheoHD.UseVisualStyleBackColor = true;
            this.CmdDelRow.Image = (Image) manager.GetObject("CmdDelRow.Image");
            this.CmdDelRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(0x62, 5);
            this.CmdDelRow.Location = point;
            this.CmdDelRow.Name = "CmdDelRow";
            size = new Size(90, 0x19);
            this.CmdDelRow.Size = size;
            this.CmdDelRow.TabIndex = 1;
            this.CmdDelRow.Text = "&2.X\x00f3a d\x00f2ng";
            this.CmdDelRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdDelRow.UseVisualStyleBackColor = true;
            this.CmdAddRow.Image = (Image) manager.GetObject("CmdAddRow.Image");
            this.CmdAddRow.ImageAlign = ContentAlignment.MiddleLeft;
            point = new Point(3, 5);
            this.CmdAddRow.Location = point;
            this.CmdAddRow.Name = "CmdAddRow";
            size = new Size(0x5d, 0x19);
            this.CmdAddRow.Size = size;
            this.CmdAddRow.TabIndex = 0;
            this.CmdAddRow.Text = "&1.Th\x00eam d\x00f2ng";
            this.CmdAddRow.TextImageRelation = TextImageRelation.ImageBeforeText;
            this.CmdAddRow.UseVisualStyleBackColor = true;
            this.Panel5.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgleft;
            this.Panel5.BackgroundImageLayout = ImageLayout.Stretch;
            this.Panel5.Controls.Add(this.TxtTyLeChietKhau);
            this.Panel5.Controls.Add(this.TxtThueSuat);
            this.Panel5.Controls.Add(this.TxtTongThanhToanNT);
            this.Panel5.Controls.Add(this.Label23);
            this.Panel5.Controls.Add(this.TxtTienThueNT);
            this.Panel5.Controls.Add(this.TxtTienHangNT);
            this.Panel5.Controls.Add(this.TxtChietKhauNT);
            this.Panel5.Controls.Add(this.Label22);
            this.Panel5.Controls.Add(this.Label21);
            this.Panel5.Controls.Add(this.Label5);
            this.Panel5.Dock = DockStyle.Right;
            point = new Point(660, 0);
            this.Panel5.Location = point;
            this.Panel5.Name = "Panel5";
            size = new Size(0xea, 0x4e);
            this.Panel5.Size = size;
            this.Panel5.TabIndex = 0;
            this.TxtTyLeChietKhau.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTyLeChietKhau.DataType = typeof(short);
            this.TxtTyLeChietKhau.FormatType = FormatTypeEnum.Integer;
            point = new Point(110, 0x5e);
            this.TxtTyLeChietKhau.Location = point;
            this.TxtTyLeChietKhau.Name = "TxtTyLeChietKhau";
            padding = new Padding(1);
            this.TxtTyLeChietKhau.Padding = padding;
            size = new Size(0x19, 20);
            this.TxtTyLeChietKhau.Size = size;
            this.TxtTyLeChietKhau.TabIndex = 0x8b;
            this.TxtTyLeChietKhau.Tag = null;
            this.TxtTyLeChietKhau.Value = (short) 0;
            this.TxtTyLeChietKhau.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTyLeChietKhau.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTyLeChietKhau.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.BorderStyle = BorderStyle.FixedSingle;
            this.TxtThueSuat.DataType = typeof(short);
            this.TxtThueSuat.FormatType = FormatTypeEnum.Integer;
            point = new Point(110, 0x74);
            this.TxtThueSuat.Location = point;
            this.TxtThueSuat.Name = "TxtThueSuat";
            padding = new Padding(1);
            this.TxtThueSuat.Padding = padding;
            size = new Size(0x19, 20);
            this.TxtThueSuat.Size = size;
            this.TxtThueSuat.TabIndex = 0x8e;
            this.TxtThueSuat.Tag = null;
            this.TxtThueSuat.Value = (short) 0;
            this.TxtThueSuat.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtThueSuat.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtThueSuat.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTongThanhToanNT.DataType = typeof(double);
            this.TxtTongThanhToanNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(110, 0x35);
            this.TxtTongThanhToanNT.Location = point;
            this.TxtTongThanhToanNT.Name = "TxtTongThanhToanNT";
            padding = new Padding(1);
            this.TxtTongThanhToanNT.Padding = padding;
            this.TxtTongThanhToanNT.ReadOnly = true;
            size = new Size(0x75, 20);
            this.TxtTongThanhToanNT.Size = size;
            this.TxtTongThanhToanNT.TabIndex = 5;
            this.TxtTongThanhToanNT.Tag = null;
            this.TxtTongThanhToanNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTongThanhToanNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTongThanhToanNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTongThanhToanNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label23.AutoSize = true;
            this.Label23.BackColor = Color.Transparent;
            point = new Point(2, 0x39);
            this.Label23.Location = point;
            this.Label23.Name = "Label23";
            size = new Size(0x3b, 13);
            this.Label23.Size = size;
            this.Label23.TabIndex = 2;
            this.Label23.Text = "Tổng cộng";
            this.TxtTienThueNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienThueNT.DataType = typeof(double);
            this.TxtTienThueNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(110, 0x1d);
            this.TxtTienThueNT.Location = point;
            this.TxtTienThueNT.Name = "TxtTienThueNT";
            padding = new Padding(1);
            this.TxtTienThueNT.Padding = padding;
            this.TxtTienThueNT.ReadOnly = true;
            size = new Size(0x75, 20);
            this.TxtTienThueNT.Size = size;
            this.TxtTienThueNT.TabIndex = 4;
            this.TxtTienThueNT.Tag = null;
            this.TxtTienThueNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienThueNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienThueNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienThueNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtTienHangNT.DataType = typeof(double);
            this.TxtTienHangNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(110, 5);
            this.TxtTienHangNT.Location = point;
            this.TxtTienHangNT.Name = "TxtTienHangNT";
            padding = new Padding(1);
            this.TxtTienHangNT.Padding = padding;
            this.TxtTienHangNT.ReadOnly = true;
            size = new Size(0x75, 20);
            this.TxtTienHangNT.Size = size;
            this.TxtTienHangNT.TabIndex = 3;
            this.TxtTienHangNT.Tag = null;
            this.TxtTienHangNT.TextAlign = HorizontalAlignment.Right;
            this.TxtTienHangNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtTienHangNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtTienHangNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.BorderStyle = BorderStyle.FixedSingle;
            this.TxtChietKhauNT.DataType = typeof(double);
            this.TxtChietKhauNT.FormatType = FormatTypeEnum.Currency;
            point = new Point(0x89, 0x5e);
            this.TxtChietKhauNT.Location = point;
            this.TxtChietKhauNT.Name = "TxtChietKhauNT";
            padding = new Padding(1);
            this.TxtChietKhauNT.Padding = padding;
            this.TxtChietKhauNT.ReadOnly = true;
            size = new Size(90, 20);
            this.TxtChietKhauNT.Size = size;
            this.TxtChietKhauNT.TabIndex = 140;
            this.TxtChietKhauNT.Tag = null;
            this.TxtChietKhauNT.TextAlign = HorizontalAlignment.Right;
            this.TxtChietKhauNT.VisibleButtons = DropDownControlButtonFlags.None;
            this.TxtChietKhauNT.VisualStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.TxtChietKhauNT.VisualStyleBaseStyle = C1.Win.C1Input.VisualStyle.Office2007Blue;
            this.Label22.AutoSize = true;
            this.Label22.BackColor = Color.Transparent;
            point = new Point(2, 0x21);
            this.Label22.Location = point;
            this.Label22.Name = "Label22";
            size = new Size(0x34, 13);
            this.Label22.Size = size;
            this.Label22.TabIndex = 1;
            this.Label22.Text = "Tiền thuế";
            this.Label21.AutoSize = true;
            point = new Point(2, 0x62);
            this.Label21.Location = point;
            this.Label21.Name = "Label21";
            size = new Size(0x51, 13);
            this.Label21.Size = size;
            this.Label21.TabIndex = 0x74;
            this.Label21.Text = "Tiền chiết khấu";
            this.Label5.AutoSize = true;
            this.Label5.BackColor = Color.Transparent;
            point = new Point(2, 9);
            this.Label5.Location = point;
            this.Label5.Name = "Label5";
            size = new Size(0x37, 13);
            this.Label5.Size = size;
            this.Label5.TabIndex = 0;
            this.Label5.Text = "Tiền h\x00e0ng";
            this.mnChungTuGoc.Items.AddRange(new ToolStripItem[] { this.mnDonHang, this.mnBaoGia });
            this.mnChungTuGoc.Name = "mnChungTuGoc";
            size = new Size(0x93, 0x30);
            this.mnChungTuGoc.Size = size;
            this.mnDonHang.Name = "mnDonHang";
            size = new Size(0x92, 0x16);
            this.mnDonHang.Size = size;
            this.mnDonHang.Text = "Đơn đặt h\x00e0ng";
            this.mnBaoGia.Name = "mnBaoGia";
            size = new Size(0x92, 0x16);
            this.mnBaoGia.Size = size;
            this.mnBaoGia.Text = "B\x00e1o gi\x00e1";
            this.ToolStrip1.BackgroundImage = ACCOUNTING.My.Resources.Resources.bgbluenoborder;
            this.ToolStrip1.Items.AddRange(new ToolStripItem[] { this.CmdAdd, this.CmdEdit, this.ToolStripSeparator2, this.CmdSave, this.CmdUnsave, this.ToolStripSeparator1, this.CmdFind, this.CmdPrint, this.ToolStripButton1, this.CmdDel, this.ToolStripSeparator3, this.CmdExit, this.ToolStripButton2, this.CmdPrintBienBan });
            point = new Point(0, 0);
            this.ToolStrip1.Location = point;
            this.ToolStrip1.Name = "ToolStrip1";
            size = new Size(0x37e, 0x19);
            this.ToolStrip1.Size = size;
            this.ToolStrip1.TabIndex = 1;
            this.ToolStrip1.Text = "ToolStrip1";
            this.CmdAdd.Image = (Image) manager.GetObject("CmdAdd.Image");
            this.CmdAdd.ImageTransparentColor = Color.White;
            this.CmdAdd.Name = "CmdAdd";
            size = new Size(0x52, 0x16);
            this.CmdAdd.Size = size;
            this.CmdAdd.Text = "&Th\x00eam mới";
            this.CmdAdd.ToolTipText = "F8 Th\x00eam mới";
            this.CmdEdit.Image = (Image) manager.GetObject("CmdEdit.Image");
            this.CmdEdit.ImageTransparentColor = Color.White;
            this.CmdEdit.Name = "CmdEdit";
            size = new Size(0x2e, 0x16);
            this.CmdEdit.Size = size;
            this.CmdEdit.Text = "&Sửa";
            this.CmdEdit.ToolTipText = "F2 Sửa";
            this.ToolStripSeparator2.Name = "ToolStripSeparator2";
            size = new Size(6, 0x19);
            this.ToolStripSeparator2.Size = size;
            this.CmdSave.Image = (Image) manager.GetObject("CmdSave.Image");
            this.CmdSave.ImageTransparentColor = Color.WhiteSmoke;
            this.CmdSave.Name = "CmdSave";
            size = new Size(0x2f, 0x16);
            this.CmdSave.Size = size;
            this.CmdSave.Text = "&Lưu";
            this.CmdSave.ToolTipText = "F10 Lưu";
            this.CmdUnsave.Image = (Image) manager.GetObject("CmdUnsave.Image");
            this.CmdUnsave.ImageTransparentColor = Color.White;
            this.CmdUnsave.Name = "CmdUnsave";
            size = new Size(0x39, 0x16);
            this.CmdUnsave.Size = size;
            this.CmdUnsave.Text = "&K.Lưu";
            this.CmdUnsave.ToolTipText = "F11 K.Lưu";
            this.ToolStripSeparator1.Name = "ToolStripSeparator1";
            size = new Size(6, 0x19);
            this.ToolStripSeparator1.Size = size;
            this.CmdFind.Image = (Image) manager.GetObject("CmdFind.Image");
            this.CmdFind.ImageTransparentColor = Color.White;
            this.CmdFind.Name = "CmdFind";
            size = new Size(0x4d, 0x16);
            this.CmdFind.Size = size;
            this.CmdFind.Text = "T\x00ecm kiếm";
            this.CmdFind.ToolTipText = "F3 T\x00ecm kiếm";
            this.CmdPrint.DropDownItems.AddRange(new ToolStripItem[] { this.cmdPrintVI, this.cmdPrintEN });
            this.CmdPrint.Image = (Image) manager.GetObject("CmdPrint.Image");
            this.CmdPrint.ImageTransparentColor = Color.White;
            this.CmdPrint.Name = "CmdPrint";
            size = new Size(0x31, 0x16);
            this.CmdPrint.Size = size;
            this.CmdPrint.Text = "&In";
            this.CmdPrint.ToolTipText = "F12 In";
            this.cmdPrintVI.Name = "cmdPrintVI";
            size = new Size(0x81, 0x16);
            this.cmdPrintVI.Size = size;
            this.cmdPrintVI.Text = "Tiếng Việt";
            this.cmdPrintEN.Name = "cmdPrintEN";
            size = new Size(0x81, 0x16);
            this.cmdPrintEN.Size = size;
            this.cmdPrintEN.Text = "Tiếng Anh";
            this.ToolStripButton1.Name = "ToolStripButton1";
            size = new Size(6, 0x19);
            this.ToolStripButton1.Size = size;
            this.CmdDel.Image = (Image) manager.GetObject("CmdDel.Image");
            this.CmdDel.ImageTransparentColor = Color.White;
            this.CmdDel.Name = "CmdDel";
            size = new Size(0x2f, 0x16);
            this.CmdDel.Size = size;
            this.CmdDel.Text = "&X\x00f3a";
            this.CmdDel.ToolTipText = "F9 X\x00f3a";
            this.ToolStripSeparator3.Name = "ToolStripSeparator3";
            size = new Size(6, 0x19);
            this.ToolStripSeparator3.Size = size;
            this.CmdExit.Alignment = ToolStripItemAlignment.Right;
            this.CmdExit.Image = (Image) manager.GetObject("CmdExit.Image");
            this.CmdExit.ImageTransparentColor = Color.White;
            this.CmdExit.Name = "CmdExit";
            size = new Size(0x3a, 0x16);
            this.CmdExit.Size = size;
            this.CmdExit.Text = "Th&o\x00e1t";
            this.ToolStripButton2.Alignment = ToolStripItemAlignment.Right;
            this.ToolStripButton2.Image = (Image) manager.GetObject("ToolStripButton2.Image");
            this.ToolStripButton2.ImageScaling = ToolStripItemImageScaling.None;
            this.ToolStripButton2.ImageTransparentColor = Color.White;
            this.ToolStripButton2.Name = "ToolStripButton2";
            size = new Size(0x35, 0x16);
            this.ToolStripButton2.Size = size;
            this.ToolStripButton2.Text = "&Help";
            this.CmdPrintBienBan.Image = (Image) manager.GetObject("CmdPrintBienBan.Image");
            this.CmdPrintBienBan.ImageTransparentColor = Color.White;
            this.CmdPrintBienBan.Name = "CmdPrintBienBan";
            size = new Size(0x56, 0x16);
            this.CmdPrintBienBan.Size = size;
            this.CmdPrintBienBan.Text = "&In bi\x00ean bản";
            this.CmdPrintBienBan.ToolTipText = "F12 In";
            this.PNDungChung.Anchor = AnchorStyles.Right | AnchorStyles.Top;
            this.PNDungChung.BackgroundImage = ACCOUNTING.My.Resources.Resources.background;
            this.PNDungChung.Controls.Add(this.CmdChuyen);
            this.PNDungChung.Controls.Add(this.CboLoaiDuLieu);
            this.PNDungChung.Controls.Add(this.CmdTimDuAn);
            this.PNDungChung.Controls.Add(this.Label33);
            this.PNDungChung.Controls.Add(this.TxtDuAn);
            point = new Point(0xc0, 0x19);
            this.PNDungChung.Location = point;
            this.PNDungChung.Name = "PNDungChung";
            size = new Size(0x2be, 0x18);
            this.PNDungChung.Size = size;
            this.PNDungChung.TabIndex = 3;
            this.PNDungChung.Visible = false;
            this.CmdChuyen.Font = new Font("Arial", 8.25f, FontStyle.Bold, GraphicsUnit.Point, 0);
            point = new Point(0x28c, 2);
            this.CmdChuyen.Location = point;
            this.CmdChuyen.Name = "CmdChuyen";
            size = new Size(0x18, 0x16);
            this.CmdChuyen.Size = size;
            this.CmdChuyen.TabIndex = 4;
            this.CmdChuyen.Text = ">";
            this.CmdChuyen.UseVisualStyleBackColor = true;
            this.CmdChuyen.Visible = false;
            this.CboLoaiDuLieu.DropDownStyle = ComboBoxStyle.DropDownList;
            this.CboLoaiDuLieu.FormattingEnabled = true;
            point = new Point(0x1e3, 2);
            this.CboLoaiDuLieu.Location = point;
            this.CboLoaiDuLieu.Name = "CboLoaiDuLieu";
            size = new Size(0xa3, 0x15);
            this.CboLoaiDuLieu.Size = size;
            this.CboLoaiDuLieu.TabIndex = 3;
            this.CboLoaiDuLieu.Visible = false;
            this.CmdTimDuAn.BackgroundImage = ACCOUNTING.My.Resources.Resources.view;
            this.CmdTimDuAn.BackgroundImageLayout = ImageLayout.Stretch;
            point = new Point(0xc1, 2);
            this.CmdTimDuAn.Location = point;
            padding = new Padding(0);
            this.CmdTimDuAn.Margin = padding;
            this.CmdTimDuAn.Name = "CmdTimDuAn";
            size = new Size(0x17, 0x16);
            this.CmdTimDuAn.Size = size;
            this.CmdTimDuAn.TabIndex = 2;
            this.CmdTimDuAn.UseVisualStyleBackColor = true;
            this.CmdTimDuAn.Visible = false;
            this.Label33.AutoSize = true;
            this.Label33.BackColor = Color.Transparent;
            point = new Point(11, 6);
            this.Label33.Location = point;
            this.Label33.Name = "Label33";
            size = new Size(0x34, 13);
            this.Label33.Size = size;
            this.Label33.TabIndex = 0;
            this.Label33.Text = "M\x00e3 &dự \x00e1n";
            this.Label33.Visible = false;
            this.TxtDuAn.Enabled = false;
            point = new Point(0x4a, 3);
            this.TxtDuAn.Location = point;
            this.TxtDuAn.Name = "TxtDuAn";
            this.TxtDuAn.ReadOnly = true;
            size = new Size(0x76, 20);
            this.TxtDuAn.Size = size;
            this.TxtDuAn.TabIndex = 1;
            this.TxtDuAn.Visible = false;
            this.C1DockingTab1.Controls.Add(this.C1DockingTabPage1);
            this.C1DockingTab1.Dock = DockStyle.Fill;
            point = new Point(0, 0xd9);
            this.C1DockingTab1.Location = point;
            this.C1DockingTab1.Name = "C1DockingTab1";
            size = new Size(0x37e, 0x126);
            this.C1DockingTab1.Size = size;
            this.C1DockingTab1.TabIndex = 4;
            this.C1DockingTab1.TabsSpacing = 5;
            this.C1DockingTab1.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab1.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab1.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage1.Controls.Add(this.VSHangHoa);
            this.C1DockingTabPage1.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage1.Location = point;
            this.C1DockingTabPage1.Name = "C1DockingTabPage1";
            size = new Size(0x37c, 0x10c);
            this.C1DockingTabPage1.Size = size;
            this.C1DockingTabPage1.TabIndex = 0;
            this.C1DockingTabPage1.Text = "Chi tiết h\x00e0ng h\x00f3a";
            this.VSHangHoa.BorderStyle = C1.Win.C1FlexGrid.Util.BaseControls.BorderStyleEnum.XpThemes;
            this.VSHangHoa.ColumnInfo = manager.GetString("VSHangHoa.ColumnInfo");
            this.VSHangHoa.Dock = DockStyle.Fill;
            this.VSHangHoa.ExtendLastCol = true;
            this.VSHangHoa.KeyActionEnter = KeyActionEnum.MoveAcross;
            point = new Point(0, 0);
            this.VSHangHoa.Location = point;
            padding = new Padding(0);
            this.VSHangHoa.Margin = padding;
            this.VSHangHoa.Name = "VSHangHoa";
            this.VSHangHoa.Rows.Count = 1;
            this.VSHangHoa.Rows.DefaultSize = 0x11;
            this.VSHangHoa.Rows.MinSize = 20;
            size = new Size(0x37c, 0x10c);
            this.VSHangHoa.Size = size;
            this.VSHangHoa.StyleInfo = manager.GetString("VSHangHoa.StyleInfo");
            this.VSHangHoa.TabIndex = 0;
            this.VSHangHoa.Tag = "BH-0000";
            this.VSHangHoa.VisualStyle = C1.Win.C1FlexGrid.VisualStyle.Office2007Blue;
            this.C1DockingTab2.Controls.Add(this.C1DockingTabPage2);
            this.C1DockingTab2.Dock = DockStyle.Top;
            point = new Point(0, 0x19);
            this.C1DockingTab2.Location = point;
            this.C1DockingTab2.Name = "C1DockingTab2";
            size = new Size(0x37e, 0xc0);
            this.C1DockingTab2.Size = size;
            this.C1DockingTab2.TabIndex = 2;
            this.C1DockingTab2.TabsSpacing = 5;
            this.C1DockingTab2.TabStyle = TabStyleEnum.Office2007;
            this.C1DockingTab2.VisualStyle = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTab2.VisualStyleBase = C1.Win.C1Command.VisualStyle.Office2007Blue;
            this.C1DockingTabPage2.Controls.Add(this.TxtDienThoai);
            this.C1DockingTabPage2.Controls.Add(this.AdvNhanVien);
            this.C1DockingTabPage2.Controls.Add(this.Label34);
            this.C1DockingTabPage2.Controls.Add(this.TxtSoChungTu);
            this.C1DockingTabPage2.Controls.Add(this.TxtGhiChuGiaoHang);
            this.C1DockingTabPage2.Controls.Add(this.Label1);
            this.C1DockingTabPage2.Controls.Add(this.Label29);
            this.C1DockingTabPage2.Controls.Add(this.TxtNgayChungTu);
            this.C1DockingTabPage2.Controls.Add(this.CboLienHe);
            this.C1DockingTabPage2.Controls.Add(this.Label13);
            this.C1DockingTabPage2.Controls.Add(this.Label7);
            this.C1DockingTabPage2.Controls.Add(this.Label11);
            this.C1DockingTabPage2.Controls.Add(this.Label2);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiTien);
            this.C1DockingTabPage2.Controls.Add(this.AdvTaiKhoanChu);
            this.C1DockingTabPage2.Controls.Add(this.Label3);
            this.C1DockingTabPage2.Controls.Add(this.CboDiaChiGiaoHang);
            this.C1DockingTabPage2.Controls.Add(this.Label9);
            this.C1DockingTabPage2.Controls.Add(this.Label28);
            this.C1DockingTabPage2.Controls.Add(this.TxtDienGiai);
            this.C1DockingTabPage2.Controls.Add(this.AdvGiaoNhan);
            this.C1DockingTabPage2.Controls.Add(this.Label25);
            this.C1DockingTabPage2.Controls.Add(this.CboLoaiGia);
            this.C1DockingTabPage2.Controls.Add(this.Label19);
            this.C1DockingTabPage2.Controls.Add(this.Label16);
            this.C1DockingTabPage2.Controls.Add(this.AdvKhachHang);
            this.C1DockingTabPage2.Image = ACCOUNTING.My.Resources.Resources.Selected;
            point = new Point(1, 0x19);
            this.C1DockingTabPage2.Location = point;
            this.C1DockingTabPage2.Name = "C1DockingTabPage2";
            size = new Size(0x37c, 0xa6);
            this.C1DockingTabPage2.Size = size;
            this.C1DockingTabPage2.TabIndex = 0;
            this.C1DockingTabPage2.Text = "Th\x00f4ng tin gửi h\x00e0ng đại l\x00fd";
            SizeF ef = new SizeF(6f, 13f);
            this.AutoScaleDimensions = ef;
            this.AutoScaleMode = AutoScaleMode.Font;
            size = new Size(0x37e, 0x24d);
            this.ClientSize = size;
            this.ControlBox = false;
            this.Controls.Add(this.C1DockingTab1);
            this.Controls.Add(this.PNDungChung);
            this.Controls.Add(this.C1DockingTab2);
            this.Controls.Add(this.Panel4);
            this.Controls.Add(this.ToolStrip1);
            this.Controls.Add(this.Label4);
            this.Controls.Add(this.cmdTimDonHang);
            this.Controls.Add(this.TxtNgayDathang);
            this.Controls.Add(this.Label6);
            this.Controls.Add(this.TxtSoDonHang);
            this.FormBorderStyle = FormBorderStyle.FixedDialog;
            this.MaximizeBox = false;
            this.MinimizeBox = false;
            this.Name = "Frm_PhieuGiaoHang";
            this.ShowIcon = false;
            this.StartPosition = FormStartPosition.CenterScreen;
            this.Tag = "BH-0017";
            this.Text = "HANG GUI DAI LY";
            this.Panel4.ResumeLayout(false);
            this.Panel4.PerformLayout();
            ((ISupportInitialize) this.TxtTienVonNT).EndInit();
            ((ISupportInitialize) this.TxtSoLuong).EndInit();
            this.Panel5.ResumeLayout(false);
            this.Panel5.PerformLayout();
            ((ISupportInitialize) this.TxtTyLeChietKhau).EndInit();
            ((ISupportInitialize) this.TxtThueSuat).EndInit();
            ((ISupportInitialize) this.TxtTongThanhToanNT).EndInit();
            ((ISupportInitialize) this.TxtTienThueNT).EndInit();
            ((ISupportInitialize) this.TxtTienHangNT).EndInit();
            ((ISupportInitialize) this.TxtChietKhauNT).EndInit();
            this.mnChungTuGoc.ResumeLayout(false);
            this.ToolStrip1.ResumeLayout(false);
            this.ToolStrip1.PerformLayout();
            this.PNDungChung.ResumeLayout(false);
            this.PNDungChung.PerformLayout();
            ((ISupportInitialize) this.C1DockingTab1).EndInit();
            this.C1DockingTab1.ResumeLayout(false);
            this.C1DockingTabPage1.ResumeLayout(false);
            this.VSHangHoa.EndInit();
            ((ISupportInitialize) this.C1DockingTab2).EndInit();
            this.C1DockingTab2.ResumeLayout(false);
            this.C1DockingTabPage2.ResumeLayout(false);
            this.C1DockingTabPage2.PerformLayout();
            this.ResumeLayout(false);
            this.PerformLayout();
        }

        public void InsertBaoGia(string strKhoa)
        {
            ClsBaoGia gia = new ClsBaoGia();
            gia.Load(strKhoa);
            this.TxtSoDonHang.Text = gia.SoChungTu;
            this.TxtSoDonHang.Tag = gia.Khoa;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(gia.NgayChungTu);
            this.AdvKhachHang.Value = gia.KhoaKhachHang;
            this.CboLoaiGia.SelectedValue = gia.KhoaLoaiGia;
            DataTable detailsIntoHoaDon = gia.GetDetailsIntoHoaDon(strKhoa);
            if (detailsIntoHoaDon != null)
            {
                int num2 = detailsIntoHoaDon.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = "";
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = "";
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["MaHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TenHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaDVT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["DVT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["QuyCach"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["SoLuong"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["DonGia"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TienHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["ThueSuat"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TienThue"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaTKHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TaiKhoanHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaTKGiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x19] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TaiKhoanGiaVon"]);
                    vSHangHoa = null;
                }
                this.TinhTong();
            }
        }

        public void InsertDonDatHang(string strKhoa)
        {
            clsDonDatHang hang = new clsDonDatHang();
            hang.Load(strKhoa);
            this.TxtSoDonHang.Text = hang.SoChungTu;
            this.TxtSoDonHang.Tag = hang.Khoa;
            this.TxtNgayDathang.Text = LVYModule.Char2Date(hang.NgayChungTu);
            this.AdvKhachHang.Value = hang.KhoaDoiTuong;
            this.CboLoaiGia.SelectedValue = modGeneral.H_GIACHUAN;
            DataTable detailsIntoHoaDon = hang.GetDetailsIntoHoaDon(strKhoa);
            if (detailsIntoHoaDon != null)
            {
                int num2 = detailsIntoHoaDon.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = "";
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = "";
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["MaHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["HangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaDonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["DonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["QuyCach"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["SoLuong"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["DonGia"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TienHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["ThueSuat"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TienThue"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["KhoaTKHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(detailsIntoHoaDon.Rows[i]["TaiKhoanHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x18] = "";
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x19] = "";
                    vSHangHoa = null;
                }
                this.TinhTong();
            }
        }

        public void InsertSoSrial(string strSoSerial)
        {
            this.VSHangHoa[this.VSHangHoa.Row, 7] = strSoSerial;
        }

        public void LoadDetailsHangHoa(string pKhoa)
        {
            DataTable listDetails = this.objHD.GetListDetails(pKhoa);
            if (listDetails != null)
            {
                int num2 = listDetails.Rows.Count - 1;
                for (int i = 0; i <= num2; i++)
                {
                    C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                    vSHangHoa.AddItem("");
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Khoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 1] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaKho"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 2] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Loai"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 3] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 4] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["Ma"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 5] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["HangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 6] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLoHang"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 7] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoSeri"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 8] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["NgayNhap"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 9] = LVYModule.Char2Date(Conversions.ToString(listDetails.Rows[i]["HanSuDung"]));
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaDonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["DonViTinh"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["QuyCach"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["SoLuong"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 14] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x10] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["GiaBanNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x11] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienBanNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x12] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeChietKhau"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x13] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienChietKhauNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 20] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TyLeThue"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x15] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TienThueNT"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x16] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTKHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x17] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TaiKhoanHangHoa"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x18] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaTKGiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x19] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["TaiKhoanGiaVon"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x1a] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaChiTiet"]);
                    vSHangHoa[vSHangHoa.Rows.Count - 1, 0x1b] = RuntimeHelpers.GetObjectValue(listDetails.Rows[i]["KhoaHoaDon"]);
                    vSHangHoa = null;
                }
            }
        }

        private void mnBaoGia_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_BaoGiaList.Dispose();
            MyProject.Forms.Frm_BaoGiaList.objFrmCall = this;
            MyProject.Forms.Frm_BaoGiaList.strConditions = " BG.TinhTrang = 1 And Rtrim(IsNull(BG.KhoaHoaDon,'')) = '' And Rtrim(IsNull(BG.KhoaDonDatHang,'')) = ''";
            MyProject.Forms.Frm_BaoGiaList.ShowDialog();
        }

        private void mnDonHang_Click(object sender, EventArgs e)
        {
            MyProject.Forms.Frm_DonDatHangBanList.Dispose();
            MyProject.Forms.Frm_DonDatHangBanList.objFrmCall = this;
            MyProject.Forms.Frm_DonDatHangBanList.strConditions = " AND DH.TinhTrang = 1 And RTRIM(ISNULL(DH.KhoaHoaDon,'')) = '' ";
            MyProject.Forms.Frm_DonDatHangBanList.ShowDialog();
        }

        public bool SaveHHDetailsTemp()
        {
            double num2 = 0.0;
            num2 = 1.0;
            clsXuatKhoChiTiet objHDHH = this.objHDHH;
            int num3 = this.VSHangHoa.Rows.Count - 1;
            for (int i = 1; i <= num3; i++)
            {
                if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() != "")
                {
                    if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim() == "")
                    {
                        this.VSHangHoa[i, 0] = modGeneral.CreatKey("ST_XuatKhoChiTiet", 15, "");
                    }
                    objHDHH.Khoa = this.VSHangHoa[i, 0].ToString().Trim();
                    objHDHH.NamThang = LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6);
                    objHDHH.KhoaPhieuXuat = this.cFrmKhoa;
                    objHDHH.NgayBan = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
                    objHDHH.KhoaHangHoa = this.VSHangHoa[i, 3].ToString().Trim();
                    objHDHH.KhoaKho = this.VSHangHoa[i, 1].ToString().Trim();
                    objHDHH.Loai = this.VSHangHoa[i, 2].ToString().Trim();
                    objHDHH.KhoaQuayKe = "";
                    objHDHH.SoLoHang = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 6]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.NgayNhap = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 8]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.HanSuDung = LVYModule.Date2Char(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 9]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    objHDHH.SoSeri = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    objHDHH.SoLuong = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objHDHH.GiaVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 14]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienVonNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing)) / num2;
                    objHDHH.TienVon = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 15]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.GiaBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x10]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TienBanNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienBan = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TyLeThue = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 20]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienThueNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienThue = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x15]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.TyLeChietKhau = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.TienChietKhau = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 0x13]), 0, modGeneral.TypeOfValue.Nothing)) * num2;
                    objHDHH.KhoaDonViTinh = this.VSHangHoa[i, 10].ToString().Trim();
                    objHDHH.QuyCach = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[i, 12]), 0, modGeneral.TypeOfValue.Nothing));
                    objHDHH.KhoaTKHangHoa = this.VSHangHoa[i, 0x16].ToString().Trim();
                    objHDHH.KhoaTKGiaVon = this.VSHangHoa[i, 0x18].ToString().Trim();
                    if (!objHDHH.Save())
                    {
                        return false;
                    }
                }
            }
            objHDHH = null;
            return true;
        }

        public void ShowData(string pKhoa)
        {
            if (this.objHD.Load(pKhoa))
            {
                clsXuatKho objHD = this.objHD;
                this.cFrmKhoa = objHD.Khoa;
                this.TxtSoDonHang.Tag = objHD.KhoaDonHang;
                this.TxtSoDonHang.Text = objHD.SoDonHang;
                this.TxtNgayDathang.Text = LVYModule.Char2Date(objHD.NgayDonHang);
                this.TxtSoChungTu.Text = objHD.SoChungTu;
                this.TxtNgayChungTu.Text = LVYModule.Char2Date(objHD.NgayChungTu);
                this.AdvKhachHang.Value = objHD.KhoaDoiTuong;
                this.CboLoaiTien.SelectedValue = objHD.LoaiTien;
                this.TxtThueSuat.Value = objHD.ThueSuat;
                this.TxtTienHangNT.Value = objHD.TienHangNT;
                this.TxtChietKhauNT.Value = objHD.TienChietKhauNT;
                this.TxtTienThueNT.Value = objHD.TienThueVATNT;
                this.TxtTongThanhToanNT.Value = (objHD.TienHangNT - objHD.TienChietKhauNT) + objHD.TienThueVATNT;
                this.AdvTaiKhoanChu.Value = objHD.KhoaTKThanhToan;
                this.TxtDienGiai.Text = objHD.DienGiai;
                this.cFrmGhiSo = objHD.GhiSo;
                this.CboLoaiGia.SelectedValue = objHD.KhoaLoaiGia;
                this.AdvNhanVien.Value = objHD.KhoaNhanVienBanHang;
                this.AdvGiaoNhan.Value = objHD.KhoaNhanVienGiaoHang;
                this.CboDiaChiGiaoHang.Text = objHD.DiaChiGiaoHang;
                this.TxtGhiChuGiaoHang.Text = objHD.DienGiaiGiaoHang;
                this.TxtTyLeChietKhau.Value = objHD.TyLeChietKhau;
                this.CboLienHe.Text = objHD.NguoiGiao;
                this.CboLoaiDuLieu.SelectedValue = objHD.DuLieu;
                if (objHD.KhoaSanPham.Trim() != "")
                {
                    clsDMSanPhamCongViec viec = new clsDMSanPhamCongViec();
                    viec.Load(objHD.KhoaSanPham);
                    this.TxtDuAn.Text = viec.Ma;
                    this.TxtDuAn.Tag = viec.Khoa;
                }
                object instance = objHD.NguoiGiao.Split(new char[] { '|' });
                this.CboLienHe.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 0 }, null));
                if (Information.UBound((Array) instance, 1) == 1)
                {
                    this.TxtDienThoai.Text = Conversions.ToString(NewLateBinding.LateIndexGet(instance, new object[] { 1 }, null));
                }
                if (objHD.CachTinhChietKhau == "HD")
                {
                    this.CKChietKhauTheoHD.Checked = true;
                }
                else
                {
                    this.CKChietKhauTheoHD.Checked = false;
                }
                this.TxtTienVonNT.Value = objHD.TienVonNT;
                this.LoadDetailsHangHoa(this.cFrmKhoa);
                objHD = null;
            }
        }

        public void TinhChietKhau(int nRow)
        {
            double num = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            int num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x12]), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x11]), 0, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 0x13] = Math.Round((double) ((num2 * num) / 100.0), 0);
            vSHangHoa = null;
        }

        public void TinhGiaBan(int nRow)
        {
            string pKhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            double num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            this.objHH.LoadGiaBan(Conversions.ToString(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 3]), "", modGeneral.TypeOfValue.Nothing)), pKhoaLoaiGia, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim());
            vSHangHoa[nRow, 0x10] = num * this.objHH.GiaBan;
            vSHangHoa = null;
        }

        private void TinhThue(int nRow)
        {
            double num = 0.0;
            string strCode = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim();
            if (strCode != "")
            {
                this.ObjLT.LoadByCode(strCode);
                C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                int num3 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 20]), 0, modGeneral.TypeOfValue.Nothing));
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x11]), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x13]), 0, modGeneral.TypeOfValue.Nothing));
                vSHangHoa[nRow, 0x15] = Math.Round((double) ((num3 * num) / 100.0), this.ObjLT.SoLe);
                vSHangHoa = null;
            }
        }

        public void TinhTienBan(int nRow)
        {
            double num = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 0x10]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 0x11] = Math.Round((double) (num * num2), Conversions.ToInteger(LVYModule.ReturnIfNull(this.ObjLT.SoLe, 0, modGeneral.TypeOfValue.Nothing)));
            vSHangHoa = null;
        }

        public void TinhTienVon(int nRow)
        {
            double num = 0.0;
            double num3 = 0.0;
            double num2 = 0.0;
            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 14]), 0, modGeneral.TypeOfValue.Nothing));
            num3 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 13]), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(vSHangHoa[nRow, 12]), 1, modGeneral.TypeOfValue.Nothing));
            vSHangHoa[nRow, 15] = (num * num3) * num2;
            vSHangHoa = null;
        }

        public void TinhTong()
        {
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x11);
            this.TxtChietKhauNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x13);
            this.TxtTienThueNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x15);
            this.TxtTienVonNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 15);
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
        }

        public void TinhTongChietKhau()
        {
            int num2 = 0;
            double num = 0.0;
            num2 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTyLeChietKhau.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            this.TxtChietKhauNT.Value = Math.Round((double) ((num2 * num) / 100.0), 0);
        }

        public void TinhTongThanhToan()
        {
            this.TxtTongThanhToanNT.Value = (Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing)) - Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing))) + Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
        }

        public void TinhTongThue()
        {
            int num4 = 0;
            double num2 = 0.0;
            double num = 0.0;
            num4 = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtThueSuat.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            num2 -= num;
            this.TxtTienThueNT.Value = Math.Round((double) ((num2 * num4) / 100.0), 0);
        }

        public void TinhTongTienHang()
        {
            this.TxtTienHangNT.Value = LVYModule.SumColGrid(this.VSHangHoa, 0x13);
        }

        private void TxtChietKhauNT_LostFocus(object sender, EventArgs e)
        {
            if (!this.TxtChietKhauNT.ReadOnly)
            {
                double num2 = 0.0;
                double num = 0.0;
                num2 = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                num = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
                if (num == 0.0)
                {
                    this.TxtTyLeChietKhau.Value = 0;
                }
                else
                {
                    this.TxtTyLeChietKhau.Value = Math.Round((double) ((num * 100.0) / num2), 0);
                }
                this.TinhTongThue();
                this.TinhTongThanhToan();
            }
        }

        private void TxtNgayChungTu_LostFocus(object sender, EventArgs e)
        {
            this.objSoCT.Load(this.mLoaiChungTu);
            this.TxtSoChungTu.Text = this.objSoCT.CreateVoucher(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), 1);
        }

        private void TxtThueSuat_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongThue();
            this.TinhTongThanhToan();
        }

        private void TxtTienThueNT_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongThanhToan();
        }

        private void TxtTyLeChietKhau_LostFocus(object sender, EventArgs e)
        {
            this.TinhTongChietKhau();
            this.TinhTongThue();
            this.TinhTongThanhToan();
        }

        public object UpdateData()
        {
            object obj2;
            clsXuatKho objHD = this.objHD;
            objHD.Khoa = this.cFrmKhoa;
            objHD.KhoaDonHang = Conversions.ToString(this.TxtSoDonHang.Tag);
            objHD.SoDonHang = this.TxtSoDonHang.Text.ToString().Trim();
            objHD.NgayDonHang = LVYModule.Date2Char(this.TxtNgayDathang.Text.ToString().Trim());
            objHD.SoChungTu = this.TxtSoChungTu.Text.Trim();
            objHD.NgayChungTu = LVYModule.Date2Char(this.TxtNgayChungTu.Text);
            objHD.KhoaDoiTuong = this.AdvKhachHang.Value;
            objHD.NguoiGiao = this.CboLienHe.Text.Trim() + "|" + this.TxtDienThoai.Text.Trim();
            objHD.KhoaBoPhan = "";
            objHD.KhoaSanPham = "";
            objHD.KhoaHopDong = "";
            objHD.LoaiTien = this.CboLoaiTien.SelectedValue.ToString().Trim();
            objHD.TyGia = 1.0;
            objHD.TienHangNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienHangNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienHang = objHD.TienHangNT;
            objHD.TienChietKhauNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtChietKhauNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienChietKhau = objHD.TienChietKhauNT;
            objHD.TienThueVATNT = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtTienThueNT.Value), 0, modGeneral.TypeOfValue.Nothing));
            objHD.TienThueVAT = objHD.TienThueVATNT;
            objHD.KhoaTKThanhToan = LVYModule.ReturnIfNull(this.AdvTaiKhoanChu.Value, "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.DienGiai = this.TxtDienGiai.Text.ToString().Trim();
            objHD.HanThanhToan = 0;
            objHD.NgayThanhToan = "";
            objHD.DaThanhToanNT = 0.0;
            objHD.DaThanhToan = 0.0;
            objHD.LoaiChungTu = "GH";
            objHD.KhoaNhanVienBanHang = this.AdvNhanVien.Value;
            objHD.KhoaLoaiGia = Conversions.ToString(this.CboLoaiGia.SelectedValue);
            objHD.KhoaNhanVienTao = modGeneral.H_USERID;
            objHD.NgayTao = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objHD.KhoaNhanVienSua = modGeneral.H_USERID;
            objHD.NgaySua = LVYModule.Date2Char(Strings.Format(DateAndTime.Today, "dd/MM/yyyy"));
            objHD.GhiSo = 1;
            objHD.KhoaDonVi = modGeneral.H_CLIENT;
            objHD.Send = 0;
            objHD.KhoaNhanVienGiaoHang = this.AdvGiaoNhan.Value;
            objHD.DiaChiGiaoHang = this.CboDiaChiGiaoHang.Text;
            objHD.DienGiaiGiaoHang = this.TxtGhiChuGiaoHang.Text;
            if (this.CKChietKhauTheoHD.Checked)
            {
                objHD.CachTinhChietKhau = "HD";
            }
            else
            {
                objHD.CachTinhChietKhau = "HH";
            }
            objHD.KhoaSanPham = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.TxtDuAn.Tag), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
            objHD.DuLieu = Conversions.ToString(this.CboLoaiDuLieu.SelectedValue);
            objHD.TienVon = Conversion.Val(RuntimeHelpers.GetObjectValue(this.TxtTienVonNT.Value));
            objHD.TienVonNT = Conversion.Val(RuntimeHelpers.GetObjectValue(this.TxtTienVonNT.Value));
            return objHD.Save();
            objHD = null;
            return obj2;
        }

        private void VSHangHoa_AfterEdit(object sender, RowColEventArgs e)
        {
            double num = 0.0;
            num = 1.0;
            if (num == 0.0)
            {
                num = 1.0;
            }
            switch (e.Col)
            {
                case 2:
                    if (this.VSHangHoa[e.Row, 2].ToString().Trim() == "CK")
                    {
                        this.VSHangHoa[e.Row, 0x10] = 0;
                        this.VSHangHoa[e.Row, 0x11] = 0;
                    }
                    break;

                case 11:
                case 12:
                    this.TinhGiaBan(e.Row);
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 13:
                    this.TinhTienVon(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 0x10:
                    this.TinhTienBan(e.Row);
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 0x12:
                    this.TinhChietKhau(e.Row);
                    this.TinhThue(e.Row);
                    break;

                case 0x13:
                    this.TinhThue(e.Row);
                    break;

                case 20:
                    this.TinhThue(e.Row);
                    break;
            }
            this.TinhTong();
        }

        private void VSHangHoa_BeforeEdit(object sender, RowColEventArgs e)
        {
            if (!this.mEnabledControl)
            {
                e.Cancel = true;
            }
            else if ((e.Col == 4) && (this.TxtSoDonHang.Text.Trim() != ""))
            {
                e.Cancel = true;
            }
            else if (e.Col == 5)
            {
                e.Cancel = true;
            }
            else if (e.Col == 7)
            {
                if (modGeneral.H_THEODOISERIALKHIXUAT & !modGeneral.H_THEODOISERI)
                {
                    e.Cancel = false;
                }
                else
                {
                    e.Cancel = true;
                }
            }
        }

        private void VSHangHoa_CellButtonClick(object sender, RowColEventArgs e)
        {
            object obj2;
            double num2 = 0.0;
            double giaBan = 0.0;
            num2 = 1.0;
            if (num2 == 0.0)
            {
                num2 = 1.0;
            }
            switch (e.Col)
            {
                case 4:
                    obj2 = SearchModule.SearchGoodsInStock(LVYModule.sLeft(LVYModule.Date2Char(this.TxtNgayChungTu.Text), 6), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 1]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim(), true);
                    if (obj2 != null)
                    {
                        if (LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)), "", modGeneral.TypeOfValue.String).ToString().Trim() != "")
                        {
                            this.objHH.Load(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)));
                            this.objHH.LoadGiaBan(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiGia.SelectedValue), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.CboLoaiTien.SelectedValue), "", modGeneral.TypeOfValue.String).ToString().Trim());
                            this.pdt = this.objHH.GetHangHoa(Conversions.ToString(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null)));
                            this.objDVT.Load(this.objHH.KhoaDonViTinh);
                            C1.Win.C1FlexGrid.C1FlexGrid vSHangHoa = this.VSHangHoa;
                            vSHangHoa[e.Row, 3] = this.objHH.Khoa;
                            vSHangHoa[e.Row, 4] = this.objHH.Ma;
                            if (modGeneral.H_LANGUAGE == "VIET")
                            {
                                vSHangHoa[e.Row, 5] = this.objHH.TenViet;
                                vSHangHoa[e.Row, 11] = this.objDVT.TenViet;
                            }
                            else
                            {
                                vSHangHoa[e.Row, 5] = this.objHH.TenAnh;
                                vSHangHoa[e.Row, 11] = this.objDVT.TenAnh;
                            }
                            vSHangHoa[e.Row, 6] = NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null).ToString().Trim();
                            vSHangHoa[e.Row, 9] = LVYModule.Char2Date(NewLateBinding.LateIndexGet(obj2, new object[] { 4 }, null).ToString().Trim());
                            vSHangHoa[e.Row, 8] = NewLateBinding.LateIndexGet(obj2, new object[] { 3 }, null).ToString().Trim();
                            vSHangHoa[e.Row, 10] = this.objHH.KhoaDonViTinh;
                            vSHangHoa[e.Row, 12] = 1;
                            vSHangHoa[e.Row, 13] = 1;
                            vSHangHoa[e.Row, 14] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                            vSHangHoa[e.Row, 15] = Conversions.ToDouble(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 7 }, null)), 0, modGeneral.TypeOfValue.Nothing));
                            if (vSHangHoa[e.Row, 2].ToString().Trim() == "HB")
                            {
                                if (modGeneral.H_GIABANBAOGOMTHUE)
                                {
                                    vSHangHoa[e.Row, 20] = this.objHH.TyLeThue;
                                    giaBan = this.objHH.GiaBan;
                                    vSHangHoa[e.Row, 0x10] = giaBan * (((double) (100 + this.objHH.TyLeThue)) / 100.0);
                                    vSHangHoa[e.Row, 0x11] = RuntimeHelpers.GetObjectValue(vSHangHoa[e.Row, 0x10]);
                                }
                                else
                                {
                                    vSHangHoa[e.Row, 0x10] = this.objHH.GiaBan;
                                    vSHangHoa[e.Row, 0x11] = this.objHH.GiaBan;
                                }
                            }
                            else
                            {
                                vSHangHoa[e.Row, 0x10] = 0;
                                vSHangHoa[e.Row, 0x11] = 0;
                            }
                            this.TinhThue(e.Row);
                            vSHangHoa[e.Row, 0x16] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKHangHoa"]);
                            vSHangHoa[e.Row, 0x17] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanHangHoa"]);
                            vSHangHoa[e.Row, 0x18] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["KhoaTKGiaVon"]);
                            vSHangHoa[e.Row, 0x19] = RuntimeHelpers.GetObjectValue(this.pdt.Rows[0]["TaiKhoanGiaVon"]);
                            vSHangHoa.Select(e.Row, 13);
                            vSHangHoa = null;
                            this.TinhChietKhau(e.Row);
                            this.TinhThue(e.Row);
                            this.TinhTong();
                        }
                        break;
                    }
                    break;

                case 7:
                    MyProject.Forms.Frm_NhapSoSeri.ObjFrmCall = this;
                    MyProject.Forms.Frm_NhapSoSeri.KhoaHangHoa = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    MyProject.Forms.Frm_NhapSoSeri.SoSerial = LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 7]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim();
                    MyProject.Forms.Frm_NhapSoSeri.SoLuong = Conversions.ToInteger(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(this.VSHangHoa[e.Row, 13]), 0, modGeneral.TypeOfValue.Nothing));
                    MyProject.Forms.Frm_NhapSoSeri.ShowDialog();
                    break;

                case 11:
                {
                    C1.Win.C1FlexGrid.C1FlexGrid grid2 = this.VSHangHoa;
                    obj2 = SearchModule.SearchDVT(LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(grid2[e.Row, 3]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim(), this.VSHangHoa, e.Row, e.Col, LVYModule.ReturnIfNull(RuntimeHelpers.GetObjectValue(grid2[e.Row, 10]), "", modGeneral.TypeOfValue.Nothing).ToString().Trim());
                    if (obj2 != null)
                    {
                        if (Information.UBound((Array) obj2, 1) >= 2)
                        {
                            grid2[e.Row, 10] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 0 }, null));
                            grid2[e.Row, 11] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 1 }, null));
                            grid2[e.Row, 12] = RuntimeHelpers.GetObjectValue(NewLateBinding.LateIndexGet(obj2, new object[] { 2 }, null));
                            this.VSHangHoa_AfterEdit(RuntimeHelpers.GetObjectValue(sender), e);
                        }
                        grid2.Select(e.Row, 13);
                        grid2 = null;
                        break;
                    }
                    break;
                }
            }
        }

        internal virtual ADVObjects AdvGiaoNhan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvGiaoNhan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvGiaoNhan = value;
            }
        }

        internal virtual ADVObjects AdvKhachHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvKhachHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                ADVObjects.ValueChangedEventHandler handler = new ADVObjects.ValueChangedEventHandler(this.AdvKhachHang_ValueChanged);
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged -= handler;
                }
                this._AdvKhachHang = value;
                if (this._AdvKhachHang != null)
                {
                    this._AdvKhachHang.ValueChanged += handler;
                }
            }
        }

        internal virtual ADVObjects AdvNhanVien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvNhanVien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvNhanVien = value;
            }
        }

        internal virtual ADVAccount AdvTaiKhoanChu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._AdvTaiKhoanChu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._AdvTaiKhoanChu = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab1 = value;
            }
        }

        internal virtual C1DockingTab C1DockingTab2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTab2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTab2 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage1 = value;
            }
        }

        internal virtual C1DockingTabPage C1DockingTabPage2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._C1DockingTabPage2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._C1DockingTabPage2 = value;
            }
        }

        internal virtual ComboBox CboDiaChiGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboDiaChiGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboDiaChiGiaoHang = value;
            }
        }

        internal virtual ComboBox CboLienHe
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLienHe;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLienHe = value;
            }
        }

        internal virtual ComboBox CboLoaiDuLieu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiDuLieu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiDuLieu = value;
            }
        }

        internal virtual ComboBox CboLoaiGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CboLoaiGia = value;
            }
        }

        internal virtual ComboBox CboLoaiTien
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CboLoaiTien;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CboLoaiTien_SelectedIndexChanged);
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged -= handler;
                }
                this._CboLoaiTien = value;
                if (this._CboLoaiTien != null)
                {
                    this._CboLoaiTien.SelectedIndexChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKChietKhauTheoHD
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKChietKhauTheoHD;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CKChietKhauTheoHD_CheckedChanged);
                if (this._CKChietKhauTheoHD != null)
                {
                    this._CKChietKhauTheoHD.CheckedChanged -= handler;
                }
                this._CKChietKhauTheoHD = value;
                if (this._CKChietKhauTheoHD != null)
                {
                    this._CKChietKhauTheoHD.CheckedChanged += handler;
                }
            }
        }

        internal virtual CheckBox CKTachThue
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CKTachThue;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CKTachThue = value;
            }
        }

        internal virtual ToolStripButton CmdAdd
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAdd;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAdd_Click);
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click -= handler;
                }
                this._CmdAdd = value;
                if (this._CmdAdd != null)
                {
                    this._CmdAdd.Click += handler;
                }
            }
        }

        internal virtual Button CmdAddRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdAddRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdAddRow_Click);
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click -= handler;
                }
                this._CmdAddRow = value;
                if (this._CmdAddRow != null)
                {
                    this._CmdAddRow.Click += handler;
                }
            }
        }

        internal virtual Button CmdChuyen
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdChuyen;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._CmdChuyen = value;
            }
        }

        internal virtual ToolStripButton CmdDel
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDel;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDel_Click);
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click -= handler;
                }
                this._CmdDel = value;
                if (this._CmdDel != null)
                {
                    this._CmdDel.Click += handler;
                }
            }
        }

        internal virtual Button CmdDelRow
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdDelRow;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdDelRow_Click);
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click -= handler;
                }
                this._CmdDelRow = value;
                if (this._CmdDelRow != null)
                {
                    this._CmdDelRow.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdEdit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdEdit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdEdit_Click);
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click -= handler;
                }
                this._CmdEdit = value;
                if (this._CmdEdit != null)
                {
                    this._CmdEdit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdExit
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdExit;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdExit_Click);
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click -= handler;
                }
                this._CmdExit = value;
                if (this._CmdExit != null)
                {
                    this._CmdExit.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdFind
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdFind;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdFind_Click);
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click -= handler;
                }
                this._CmdFind = value;
                if (this._CmdFind != null)
                {
                    this._CmdFind.Click += handler;
                }
            }
        }

        internal virtual ToolStripSplitButton CmdPrint
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrint;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrint_Click);
                EventHandler handler2 = new EventHandler(this.CmdPrint_ButtonClick);
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click -= handler;
                    this._CmdPrint.ButtonClick -= handler2;
                }
                this._CmdPrint = value;
                if (this._CmdPrint != null)
                {
                    this._CmdPrint.Click += handler;
                    this._CmdPrint.ButtonClick += handler2;
                }
            }
        }

        internal virtual ToolStripButton CmdPrintBienBan
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdPrintBienBan;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdPrintBienBan_Click);
                if (this._CmdPrintBienBan != null)
                {
                    this._CmdPrintBienBan.Click -= handler;
                }
                this._CmdPrintBienBan = value;
                if (this._CmdPrintBienBan != null)
                {
                    this._CmdPrintBienBan.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem cmdPrintEN
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdPrintEN;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPrintEN_Click);
                if (this._cmdPrintEN != null)
                {
                    this._cmdPrintEN.Click -= handler;
                }
                this._cmdPrintEN = value;
                if (this._cmdPrintEN != null)
                {
                    this._cmdPrintEN.Click += handler;
                }
            }
        }

        internal virtual ToolStripMenuItem cmdPrintVI
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdPrintVI;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdPhieuXuat_Click);
                if (this._cmdPrintVI != null)
                {
                    this._cmdPrintVI.Click -= handler;
                }
                this._cmdPrintVI = value;
                if (this._cmdPrintVI != null)
                {
                    this._cmdPrintVI.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdSave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdSave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdSave_Click);
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click -= handler;
                }
                this._CmdSave = value;
                if (this._CmdSave != null)
                {
                    this._CmdSave.Click += handler;
                }
            }
        }

        internal virtual Button cmdTimDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._cmdTimDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.cmdTimDonHang_Click);
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click -= handler;
                }
                this._cmdTimDonHang = value;
                if (this._cmdTimDonHang != null)
                {
                    this._cmdTimDonHang.Click += handler;
                }
            }
        }

        internal virtual Button CmdTimDuAn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdTimDuAn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdTimDuAn_Click);
                if (this._CmdTimDuAn != null)
                {
                    this._CmdTimDuAn.Click -= handler;
                }
                this._CmdTimDuAn = value;
                if (this._CmdTimDuAn != null)
                {
                    this._CmdTimDuAn.Click += handler;
                }
            }
        }

        internal virtual ToolStripButton CmdUnsave
        {
            [DebuggerNonUserCode]
            get
            {
                return this._CmdUnsave;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.CmdUnsave_Click);
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click -= handler;
                }
                this._CmdUnsave = value;
                if (this._CmdUnsave != null)
                {
                    this._CmdUnsave.Click += handler;
                }
            }
        }

        public bool EnabledControl
        {
            get
            {
                return this.mEnabledControl;
            }
            set
            {
                this.mEnabledControl = value;
                this.CmdAdd.Enabled = !value & this.mAllowAdd;
                this.CmdEdit.Enabled = !value & this.mAllowEdit;
                this.CmdSave.Enabled = value;
                this.CmdUnsave.Enabled = value;
                this.CmdDel.Enabled = !value & this.mAllowDel;
                this.CmdFind.Enabled = !value;
                this.CmdExit.Enabled = !value;
                this.CmdAddRow.Enabled = value;
                this.CmdDelRow.Enabled = value;
                this.CmdPrint.Enabled = !value;
                this.TxtSoChungTu.ReadOnly = !value;
                this.TxtNgayChungTu.Enabled = value;
                this.CboLoaiTien.Enabled = value;
                this.TxtDienGiai.ReadOnly = !value;
                this.CboLienHe.Enabled = value;
                this.TxtDienThoai.ReadOnly = !value;
                this.cmdTimDonHang.Enabled = value;
                this.TxtThueSuat.ReadOnly = !value;
                this.AdvKhachHang.ReadOnly = !value;
                this.AdvTaiKhoanChu.ReadOnly = !value;
                this.AdvNhanVien.ReadOnly = !value;
                this.CboLoaiGia.Enabled = value;
                this.AdvGiaoNhan.ReadOnly = !value;
                this.CKTachThue.Enabled = value;
                this.CboDiaChiGiaoHang.Enabled = value;
                this.TxtGhiChuGiaoHang.ReadOnly = !value;
                this.CKChietKhauTheoHD.Enabled = value;
                if (this.CKChietKhauTheoHD.Checked)
                {
                    this.TxtTyLeChietKhau.ReadOnly = !value;
                }
                else
                {
                    this.TxtTyLeChietKhau.ReadOnly = true;
                }
                this.CboLoaiDuLieu.Enabled = value;
                this.CmdChuyen.Enabled = !value;
            }
        }

        internal virtual ImageList ImageList1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ImageList1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ImageList1 = value;
            }
        }

        internal virtual Label Label1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label1 = value;
            }
        }

        internal virtual Label Label11
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label11;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label11 = value;
            }
        }

        internal virtual Label Label13
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label13;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label13 = value;
            }
        }

        internal virtual Label Label16
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label16;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label16 = value;
            }
        }

        internal virtual Label Label19
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label19;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label19 = value;
            }
        }

        internal virtual Label Label2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label2 = value;
            }
        }

        internal virtual Label Label21
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label21;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label21 = value;
            }
        }

        internal virtual Label Label22
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label22;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label22 = value;
            }
        }

        internal virtual Label Label23
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label23;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label23 = value;
            }
        }

        internal virtual Label Label25
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label25;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label25 = value;
            }
        }

        internal virtual Label Label28
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label28;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label28 = value;
            }
        }

        internal virtual Label Label29
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label29;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label29 = value;
            }
        }

        internal virtual Label Label3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label3 = value;
            }
        }

        internal virtual Label Label33
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label33;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label33 = value;
            }
        }

        internal virtual Label Label34
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label34;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label34 = value;
            }
        }

        internal virtual Label Label4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label4 = value;
            }
        }

        internal virtual Label Label5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label5 = value;
            }
        }

        internal virtual Label Label6
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label6;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label6 = value;
            }
        }

        internal virtual Label Label7
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label7;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label7 = value;
            }
        }

        internal virtual Label Label9
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Label9;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Label9 = value;
            }
        }

        internal virtual ToolStripMenuItem mnBaoGia
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnBaoGia;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.mnBaoGia_Click);
                if (this._mnBaoGia != null)
                {
                    this._mnBaoGia.Click -= handler;
                }
                this._mnBaoGia = value;
                if (this._mnBaoGia != null)
                {
                    this._mnBaoGia.Click += handler;
                }
            }
        }

        internal virtual ContextMenuStrip mnChungTuGoc
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnChungTuGoc;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._mnChungTuGoc = value;
            }
        }

        internal virtual ToolStripMenuItem mnDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._mnDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.mnDonHang_Click);
                if (this._mnDonHang != null)
                {
                    this._mnDonHang.Click -= handler;
                }
                this._mnDonHang = value;
                if (this._mnDonHang != null)
                {
                    this._mnDonHang.Click += handler;
                }
            }
        }

        internal virtual Panel Panel4
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel4;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel4 = value;
            }
        }

        internal virtual Panel Panel5
        {
            [DebuggerNonUserCode]
            get
            {
                return this._Panel5;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._Panel5 = value;
            }
        }

        internal virtual Panel PNDungChung
        {
            [DebuggerNonUserCode]
            get
            {
                return this._PNDungChung;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._PNDungChung = value;
            }
        }

        internal virtual ToolStrip ToolStrip1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStrip1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStrip1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripButton1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton1 = value;
            }
        }

        internal virtual ToolStripButton ToolStripButton2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripButton2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripButton2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator1
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator1;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator1 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator2
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator2;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator2 = value;
            }
        }

        internal virtual ToolStripSeparator ToolStripSeparator3
        {
            [DebuggerNonUserCode]
            get
            {
                return this._ToolStripSeparator3;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._ToolStripSeparator3 = value;
            }
        }

        internal virtual C1NumericEdit TxtChietKhauNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtChietKhauNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtChietKhauNT_LostFocus);
                if (this._TxtChietKhauNT != null)
                {
                    this._TxtChietKhauNT.LostFocus -= handler;
                }
                this._TxtChietKhauNT = value;
                if (this._TxtChietKhauNT != null)
                {
                    this._TxtChietKhauNT.LostFocus += handler;
                }
            }
        }

        internal virtual TextBox TxtDienGiai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienGiai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienGiai = value;
            }
        }

        internal virtual TextBox TxtDienThoai
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDienThoai;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDienThoai = value;
            }
        }

        internal virtual TextBox TxtDuAn
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtDuAn;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtDuAn = value;
            }
        }

        internal virtual TextBox TxtGhiChuGiaoHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtGhiChuGiaoHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtGhiChuGiaoHang = value;
            }
        }

        internal virtual DateTimePicker TxtNgayChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtNgayChungTu_LostFocus);
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus -= handler;
                }
                this._TxtNgayChungTu = value;
                if (this._TxtNgayChungTu != null)
                {
                    this._TxtNgayChungTu.LostFocus += handler;
                }
            }
        }

        internal virtual DateTimePicker TxtNgayDathang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtNgayDathang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtNgayDathang = value;
            }
        }

        internal virtual TextBox TxtSoChungTu
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoChungTu;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoChungTu = value;
            }
        }

        internal virtual TextBox TxtSoDonHang
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoDonHang;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoDonHang = value;
            }
        }

        internal virtual C1NumericEdit TxtSoLuong
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtSoLuong;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtSoLuong = value;
            }
        }

        internal virtual C1NumericEdit TxtThueSuat
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtThueSuat;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtThueSuat_LostFocus);
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.LostFocus -= handler;
                }
                this._TxtThueSuat = value;
                if (this._TxtThueSuat != null)
                {
                    this._TxtThueSuat.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTienHangNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienHangNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienHangNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTienThueNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienThueNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTienThueNT_LostFocus);
                if (this._TxtTienThueNT != null)
                {
                    this._TxtTienThueNT.LostFocus -= handler;
                }
                this._TxtTienThueNT = value;
                if (this._TxtTienThueNT != null)
                {
                    this._TxtTienThueNT.LostFocus += handler;
                }
            }
        }

        internal virtual C1NumericEdit TxtTienVonNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTienVonNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTienVonNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTongThanhToanNT
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTongThanhToanNT;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                this._TxtTongThanhToanNT = value;
            }
        }

        internal virtual C1NumericEdit TxtTyLeChietKhau
        {
            [DebuggerNonUserCode]
            get
            {
                return this._TxtTyLeChietKhau;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                EventHandler handler = new EventHandler(this.TxtTyLeChietKhau_LostFocus);
                if (this._TxtTyLeChietKhau != null)
                {
                    this._TxtTyLeChietKhau.LostFocus -= handler;
                }
                this._TxtTyLeChietKhau = value;
                if (this._TxtTyLeChietKhau != null)
                {
                    this._TxtTyLeChietKhau.LostFocus += handler;
                }
            }
        }

        internal virtual C1.Win.C1FlexGrid.C1FlexGrid VSHangHoa
        {
            [DebuggerNonUserCode]
            get
            {
                return this._VSHangHoa;
            }
            [MethodImpl(MethodImplOptions.Synchronized), DebuggerNonUserCode]
            set
            {
                RowColEventHandler handler = new RowColEventHandler(this.VSHangHoa_BeforeEdit);
                RowColEventHandler handler2 = new RowColEventHandler(this.VSHangHoa_AfterEdit);
                RowColEventHandler handler3 = new RowColEventHandler(this.VSHangHoa_CellButtonClick);
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit -= handler;
                    this._VSHangHoa.AfterEdit -= handler2;
                    this._VSHangHoa.CellButtonClick -= handler3;
                }
                this._VSHangHoa = value;
                if (this._VSHangHoa != null)
                {
                    this._VSHangHoa.BeforeEdit += handler;
                    this._VSHangHoa.AfterEdit += handler2;
                    this._VSHangHoa.CellButtonClick += handler3;
                }
            }
        }
    }
}

